Search code examples
springspring-mvcspring-annotations

Spring @RequestMapping and trailing slash


I am trying to map a method in a Controller using the annotation with URI template:

@RequestMapping(value="/select/{customerNumber}/{resource}", method=RequestMethod.GET)

It appears that this does not get mapped if there is a trailing slash at the end of "resource".

Update: Using Spring 3.0.2 release

Update 2: @RequestMapping seems to behave differently for URI templates vs where I don't use template. For non-template, it does not work if I have a trailing slash. But for templates it does not work if I don't have a trailing slash. Very strange!


Solution

  • This is fixed in 3.0.3 release. SPR-7064