Closed
Description
Laplie Anderson opened SPR-14032 and commented
Currently, the way to get the wildcard part of a request mapping is a bit cumbersome:
@RequestMapping("/somePrefix/{element}/**")
public void myAction(@PathVariable String element, HttpServletRequest request) {
String path = (String) request.getAttribute(HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
// do some path manipulation here
// do actual work
}
It would be nicer if we could just have the element assigned directly:
@RequestMapping("/somePrefix/{element}/{**}")
public void myAction(@PathVariable String element, @PathVariable String wildcard) {
// do actual work
}
Issue Links:
- Wildcard mapping for path segments at the end of a @RequestMapping [SPR-14193] #18766 Wildcard mapping for path segments at the end of a
@RequestMapping