Skip to content

PathVariable mappings are greedy over hard coded mappings [SPR-5367] #10040

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: commits 4108927, c7d1d3c

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions