Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.0.2
    • Fix Version/s: 3.0.3
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      I am having a new issue where every request mapping ending in a "/" is mapped to the root mapping. In addition, in 3.0.1 the handler ignored the trailing slash in mappings allowing a request for "/test/" to be mapped to the method annotated with "/test". Below are the methods in my test controller and the corresponding log messages. This issue started with my upgrade to 3.0.2. Could it be related to SPR-7052?

      @RequestMapping(value = "/", method = RequestMethod.GET)
      public String index(ModelMap model) throws Exception {
      // In 3.0.1 this mapped only to "/". In 3.0.2 maps to all paths ending in "/".

      // Context Path = "/application"
      // Servlet Path = "/"
      // Request Uri = "/application/"
      }

      @RequestMapping(value = "/test", method = RequestMethod.GET)
      public String test(ModelMap model) throws Exception {
      // In 3.0.1 this method mapped to the "/test/" path and "/test" path.

      // Context Path = "/application"
      // Servlet Path = "/test"
      // Request Uri = "/application/test"
      }

      @RequestMapping(value = "/test/", method = RequestMethod.GET)
      public String test2(ModelMap model) throws Exception {
      // In 3.0.1 this method mapped to the "/test/" path

      // Context Path = "/application"
      // Servlet Path = "/test/"
      // Request Uri = "/application/test/"
      }

      [DefaultAnnotationHandlerMapping:397] Root mapping to handler [TestController@fa5e4e4]
      [DefaultAnnotationHandlerMapping:410] Mapped URL path [/test] onto handler [TestController@fa5e4e4]
      [DefaultAnnotationHandlerMapping:410] Mapped URL path [/test/] onto handler [TestController@fa5e4e4]
      [DefaultAnnotationHandlerMapping:220] Mapping [/] to handler 'TestController@fa5e4e4'
      [DispatcherServlet:690] DispatcherServlet with name 'spring' processing GET request for [/application/test/]
      [HandlerMethodInvoker:171] Invoking request handler method: public java.lang.String TestController.index(org.springframework.ui.ModelMap) throws java.lang.Exception

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                mpugmire Mike Pugmire
                Last updater:
                Spring Issuemaster
              • Votes:
                2 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  40 weeks, 1 day ago