Description
Scott Andrews opened SPR-5367 and commented
Hard coded request mapping values should take precedence over path variables. Wild card patterns in a path are currently inferior to explicit values. Path variables should be applied after explicit paths and before wild cards.
For example:
@RequestMapping
(value = "/resources/new/", method = RequestMethod.GET)
is currently trumped by
@RequestMapping
(value = "/resources/{resourceName}/", method = RequestMethod.GET)
@RequestMapping
(value = "/resources/new/", method = RequestMethod.GET)
currently trumps
@RequestMapping
(value = "/resources/*/", method = RequestMethod.GET)
@RequestMapping
(value = "/resources/new/", method = RequestMethod.GET)
should trump
@RequestMapping
(value = "/resources/{resourceName}/", method = RequestMethod.GET)
should trump
@RequestMapping
(value = "/resources/*/", method = RequestMethod.GET)
Affects: 3.0 M1
Issue Links:
- @RequestMapping best match gives wrong Controller method when using wildcards [SPR-5362] #10035
@RequestMapping
best match gives wrong Controller method when using wildcards ("is duplicated by") - @Controller method order effects @RequestMapping behavior in ways not expected [SPR-5731] #10401
@Controller
method order effects@RequestMapping
behavior in ways not expected - REOPENED -PathVariable mappings are greedy over hard coded mappings [SPR-5924] #10593 REOPENED -PathVariable mappings are greedy over hard coded mappings
- Synchronization in AnnotationMethodHandlerAdapter [SPR-7525] #12183 Synchronization in AnnotationMethodHandlerAdapter