title: Spring MVC Mapping problem
body: <p>I have what I thought was a simple Spring MVC app.  However, I can seem to set the requestMappings correctly.  What's strange is that the logs show that the url is mapped to the proper controller, yet the Dispatcher cant seem to find it at runtime.  Any suggestions would be much appreciated:</p>
  
  <p>Log</p>
  
  <pre><code>INFO: Mapped URL path [/app/index] onto handler     [com.noisyair.whatisayis.web.MainController@420a52f]
  Jan 11, 2010 2:14:21 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/app/index.*] onto handler [com.noisyair.whatisayis.web.MainController@420a52f]
  Jan 11, 2010 2:14:21 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/app/index/] onto handler [com.noisyair.whatisayis.web.MainController@420a52f]
  Jan 11, 2010 2:14:21 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/app/tags/{tag}] onto handler [com.noisyair.whatisayis.web.SearchByTagController@7b3cb2c6]
  Jan 11, 2010 2:14:21 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/app/tags/{tag}.*] onto handler [com.noisyair.whatisayis.web.SearchByTagController@7b3cb2c6]
  Jan 11, 2010 2:14:21 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
  INFO: Mapped URL path [/app/tags/{tag}/] onto handler [com.noisyair.whatisayis.web.SearchByTagController@7b3cb2c6]
  Jan 11, 2010 2:14:21 PM org.springframework.web.servlet.FrameworkServlet initServletBean
  INFO: FrameworkServlet 'wisi': initialization completed in 237 ms
  Jan 11, 2010 2:14:21 PM org.apache.catalina.core.StandardContext start
  INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/] has already been started
  Jan 11, 2010 2:14:41 PM org.springframework.web.servlet.DispatcherServlet noHandlerFound
  WARNING: No mapping found for HTTP request with URI [/app/index] in DispatcherServlet with name 'wisi'
  </code></pre>
  
  <p>Web.xml file</p>
  
  <pre><code>&lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;!-- The Spring MVC framework handles all of this stuff.  Just pass it along --&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;wisi&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;wisi&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/app/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>Controller class:</p>
  
  <pre><code>@Controller
  public class MainController {
  
  @Autowired
  private LearningEntryService learningEntryService;
  
  public LearningEntryService getLearningEntryService() {
      return learningEntryService;
  }
  
  public void setLearningEntryService(LearningEntryService learningEntryService) {
      this.learningEntryService = learningEntryService;
  }
  
  @RequestMapping(value = "/app/index", method = RequestMethod.GET)
  public ModelAndView sayHello(HttpServletRequest request,
          HttpServletResponse response) throws ServletException, IOException {
  
      Map&lt;String, Object&gt; model = new HashMap&lt;String, Object&gt;();
      List&lt;LearningEntry&gt; le = learningEntryService.getLearningEntries();
      model.put("learningEntries", le);
      return new ModelAndView("main", model);
  }
  }
  </code></pre>