title: Spring MVC 404 error
body: <p>I'm going crazy and can't understand what the problem is:</p>
  
  <p>I have the following structure: </p>
  
  <pre><code>SpringMVC
    +WebContent
        -web-inf
          -web.xml
          -springMVC-servlet.xml
        -index.jsp
        -security
             -login.jsp 
  </code></pre>
  
  <p>web.xml</p>
  
  <pre><code>&lt;display-name&gt;springMVC&lt;/display-name&gt; 
  &lt;servlet&gt; 
    &lt;servlet-name&gt;springMVC&lt;/servlet-name&gt; 
    &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; 
  &lt;/servlet&gt; 
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;springMVC&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt; 
    &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;springMVC&lt;/servlet-name&gt;
    &lt;url-pattern&gt;*.do&lt;/url-pattern&gt; 
  &lt;/servlet-mapping&gt; 
  &lt;servlet-mapping&gt; 
    &lt;servlet-name&gt;springMVC&lt;/servlet-name&gt; 
    &lt;url-pattern&gt;/index.html&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;welcome-file-list&gt; 
    &lt;welcome-file&gt;index.html&lt;/welcome-file&gt; 
  &lt;/welcome-file-list&gt;
  </code></pre>
  
  <p>springMVC-servlet.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xsi:schemaLocation=" http://www.springframework.org/schema/beans 
          http://www.springframework.org/schema/beans/spring-beans-3.0.xsd     
          http://www.springframework.org/schema/context  
          http://www.springframework.org/schema/context/spring-context-3.0.xsd 
          http://www.springframework.org/schema/mvc 
          http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd  
          http://www.springframework.org/schema/aop 
          http://www.springframework.org/schema/aop/spring-aop-3.0.xsd" 
          xmlns:mvc="http://www.springframework.org/schema/mvc"  
          xmlns:aop="http://www.springframework.org/schema/aop" 
          xmlns:context="http://www.springframework.org/schema/context" 
          xmlns:p="http://www.springframework.org/schema/p" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns="http://www.springframework.org/schema/beans"&gt; 
  
      &lt;context:annotation-config/&gt; 
      &lt;context:component-scan base-package="com.vanilla.springMVC"/&gt; 
  
      &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" &gt; 
         &lt;property name="prefix"&gt; 
            &lt;value&gt;/&lt;/value&gt; 
         &lt;/property&gt; 
         &lt;property name="suffix"&gt; 
         &lt;value&gt;.jsp&lt;/value&gt; 
         &lt;/property&gt; 
      &lt;/bean&gt; 
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>My Controller:</p>
  
  <pre><code>package com.vanilla.springMVC;
  
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.portlet.ModelAndView;
  
  @Controller
  public class DefaultController {
  
      @RequestMapping(value="/index.html", method=RequestMethod.GET)
      public ModelAndView index(){
          ModelAndView mv = new ModelAndView("index");
          return mv;
      }
  
      @RequestMapping(value="/login.html", method=RequestMethod.GET)
      public ModelAndView loginPage(){
          ModelAndView mv = new ModelAndView("/security/login");
          return mv;
      }
  }
  </code></pre>
  
  <p>I have no problem to navigate to /index.html</p>
  
  <p><a href="http://localhost:8080/SpringMVC/index.html" rel="noreferrer">http://localhost:8080/SpringMVC/index.html</a>
  works perfect.</p>
  
  <p>however when I'm navigating to 
  <a href="http://localhost:8080/SpringMVC/login.html" rel="noreferrer">http://localhost:8080/SpringMVC/login.html</a>
  i have 404 error.</p>
  
  <pre><code>HTTP Status 404 - /SpringMVC/login.jsp    
  type Status report
  message /SpringMVC/login.jsp
  description The requested resource (/SpringMVC/login.jsp) is not available.
  </code></pre>
  
  <p>I don't want to move login.jsp on the same level as index.jsp, but why do I have this problem?</p>