-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Zhou Wu opened SPR-6164 and commented
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.
Affects: 3.0 M4, 3.0 RC1
Attachments:
- MyController.java (950 bytes)
Issue Links:
- RESTful URLs with path variables containing dots are incorrectly mapped [SPR-6231] #10899 RESTful URLs with path variables containing dots are incorrectly mapped ("is duplicated by")
- Spring eats @PathVariable part after last dot [SPR-10026] #14660 Spring eats
@PathVariable
part after last dot ("is duplicated by") - @PathVariable will cut off the last point [SPR-14678] #19242
@PathVariable
will cut off the last point ("is duplicated by") - Allow valid file extension paths for content negotiation to be specified [SPR-7632] #12288 Allow valid file extension paths for content negotiation to be specified
- ReSTful URLs with content type extension do not work properly [SPR-5537] #10208 ReSTful URLs with content type extension do not work properly
Referenced from: commits 8292491, e24e768
2 votes, 11 watchers