Custom regex matching for @PathVariable [SPR-5812] #10482
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Scott Andrews opened SPR-5812 and commented
The pattern for matching
@PathVariable
values in a URI is currently fixed. This makes it impossible for the request dispatcher to pick the intended mapping for complex mappings.For example, the current infrastructure cannot distinguish between these two mappings:
The "symbolicName" path variable is greedy, and the first mapping is selected for both values:
The value of {symbolicName} will be "com.example" or "com.example-sources" respectively.
By specifying a custom regex pattern for the variable, a user can restrict the greediness of the first variable to the indented segment of the URI.
It may be desirable to locate the regex in the
@PathVariable
annotation instead of in the@RequestMapping
value.Affects: 3.0 M3
Referenced from: commits ed98bf0
The text was updated successfully, but these errors were encountered: