title: Spring MVC mapping not working: PageNotFound
body: <p>When i visit localhost:8080/<strong>home</strong> - i get:</p>
  
  <pre><code>WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/home] in DispatcherServlet with name 'appServlet'
  </code></pre>
  
  <p>When i visit localhost:8080/ or localhost:8080/index all look ok.</p>
  
  <p>Why one path works, and another don't?</p>
  
  <p>And thing, that confuse me: localhost:8080/homepage.html - return me my <strong>home</strong> view.</p>
  
  <hr>
  
  <p>So my project here: <a href="https://github.com/IRus/jMusic" rel="nofollow">https://github.com/IRus/jMusic</a></p>
  
  <p>my <strong>web.xml</strong></p>
  
  <pre><code>&lt;!-- Base servlet handles all requests to the application. --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/spring/appServlet/servlet-context.xml&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;appServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p><strong>servlet-context.xml</strong> - i using tiles</p>
  
  <pre><code>&lt;annotation-driven/&gt;
  
  &lt;resources mapping="/resources/**" location="/resources/"/&gt;
  
  &lt;beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;beans:property name="prefix" value="/WEB-INF/views/"/&gt;
      &lt;beans:property name="suffix" value=".jsp"/&gt;
      &lt;beans:property name="order" value="1" /&gt;
  &lt;/beans:bean&gt;
  
  &lt;beans:import resource="controllers.xml"/&gt;
  &lt;beans:import resource="tiles.xml" /&gt;
  &lt;beans:import resource="i18n.xml"/&gt;
  &lt;beans:import resource="themes.xml"/&gt;
  </code></pre>
  
  <p><strong>tiles.xml</strong></p>
  
  <pre><code>&lt;bean id="tilesviewResolver" class="org.springframework.web.servlet.view.tiles2.TilesViewResolver"&gt;
          &lt;property name="order" value="0"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"&gt;
      &lt;property name="definitions"&gt;
          &lt;list&gt;
              &lt;value&gt;/WEB-INF/views/tiles-definitions.xml&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p><strong>ErrorController</strong></p>
  
  <pre><code>@Controller
  public class ErrorController {
  
      @RequestMapping("/403")
      public String error403() {
          return "403";
      }
  
      @RequestMapping("/404")
      public String error404() {
          return "404";
      }
  
  }
  </code></pre>
  
  <p><strong>UserController</strong></p>
  
  <pre><code>@Controller
  public class UserController {
  
      @Autowired
      private UserService userService;
  
      @RequestMapping("/")
      public String index() {
          return "redirect:/index";
      }
  
      @RequestMapping("/home")
      public String home() {
          return "home";
      }
  
      @RequestMapping("/login")
      public String login() {
          return "login";
      }
  
      @RequestMapping("/index")
      public String listUsers(Map&lt;String, Object&gt; map) {
  
          map.put("user", new User());
          map.put("userList", userService.listUser());
  
          return "user";
      }
  
      @RequestMapping(value = "/add", method = RequestMethod.POST)
      public String addUser(@ModelAttribute("user") User user,
                               BindingResult result) {
  
          userService.addUser(user);
  
          return "redirect:/index";
      }
  
      @RequestMapping("/delete/{idUser}")
      public String deleteUser(@PathVariable("idUser") Long idUser) {
  
          userService.removeUser(idUser);
  
          return "redirect:/index";
      }
  }
  </code></pre>
  
  <p><strong>Logs</strong>
  Here: <a href="https://gist.github.com/IRus/2ac97c66070001247011" rel="nofollow">https://gist.github.com/IRus/2ac97c66070001247011</a></p>
  
  <p>Interested moment in logs:</p>
  
  <p>Mapped URL path [/<strong>homepage.html</strong>] into handler 'userController'
  I added, and delete thats @RequestMapping in controller, but it still alive </p>
  
  <p>I work in Idea 12.0.4</p>