Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-6164

a Uri Value is incorrectly extracted if it contains '.'.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: 3.0 M4, 3.0 RC1
    • Fix Version/s: 3.1 RC1
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Suppose we have the controller request mapping as the following

      @RequestMapping(value = "/my/

      {vari}", method = RequestMethod.GET)
      @ResponseBody
      public String getVari(@PathVariable String vari) { System.out.println("vari=" + vari); return vari; }


      If a request such as "http://localhost/myapp/my/abc.mycontroller.com" is submitted, the actually value of 'vari' obtained by Spring API only returns 'abc.mycontroller'.

      Further investigation turns out the issue is at line 564 in https://src.springframework.org/svn/spring-framework/tags/spring-framework-3.0.0.RC1/org.springframework.web.servlet/src/main/java/org/springframework/web/servlet/mvc/annotation/AnnotationMethodHandlerAdapter.java. The pattern generated by the line results in "{vari}

      .*". With the 'pathMatcher' (the matcher used at line 565) object created by AntPathStringMatcher("

      {vari}

      .*", "abc.mycontroller.com", map), the value of 'vari' will be 'abc.mycontroller' in the 'map' variable after executing line 566.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rstoya05-aop Rossen Stoyanchev
                Reporter:
                zwu_ca Zhou Wu
                Last updater:
                Brian Clozel
              • Votes:
                2 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 34 weeks, 5 days ago

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.1d
                  0.1d