title: How to debug Spring MVC url mapping?
body: <p>I am using Spring MVC 3 and am having an issue with a URL mapping. I have a method</p>
  
  <pre><code> @Controller
   public class DocumentController {
        @RequestMapping( value="/docs/pupil/classes/{courseCategoryType}", method=RequestMethod.GET )
        public ModelAndView listClassesForPupil( @PathVariable("courseCategoryType") final String courseCategoryType ){
              System.err.print( "\n\n\n\t\t--- XXXXX ---\n\n\n" );
        }
   }
  </code></pre>
  
  <p>I am trying to use the <a href="http://static.springsource.org/spring/docs/3.1.0.M1/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping-uri-templates" rel="noreferrer" title="Spring URI Template Syntax">Spring URI template syntax</a>, and I know that is getting mapped because in console I see:</p>
  
  <pre><code> 11:22:12,108  INFO DefaultAnnotationHandlerMapping:411 - Mapped URL path [/docs/pupil/classes/{courseCategoryType}] onto handler 'documentController'
   11:22:12,108  INFO DefaultAnnotationHandlerMapping:411 - Mapped URL path [/docs/pupil/classes/{courseCategoryType}.*] onto handler 'documentController'
   11:22:12,108  INFO DefaultAnnotationHandlerMapping:411 - Mapped URL path [/docs/pupil/classes/{courseCategoryType}/] onto handler 'documentController'
  </code></pre>
  
  <p>However, when I enter the URL<code>https://localhost/docs/pupil/classes/ACADEMIC</code> in browser I get a 404 error and I do not see anything printed out in the console. I replaced the print out code that just throws an exception, and it didn't seem to get thrown either. A coworker suggested there should be a way of viewing how the URL resolution is being done but a <a href="http://www.google.ca/search?q=spring%20url%20resolver%20debug%20enable" rel="noreferrer">Google search</a> didn't seem to turn up anything.</p>
  
  <p>Any suggestions as how to debug this?</p>