Hi,
I need to know the value of the wildcard match for a RequestMapping within a controller's method. I realize a PathVariable can be used to access part of the path but I have not found a way to access full wildcard matches.
For example:
I could inject the HttpServletRequest but that won't work when the controller is called from within a jsp:include or tiles. Hence, I need a reliable way to access the wildcard value.Code:@RequestMapping(value = "/cms/*", method = RequestMethod.GET) public void renderContent() { // I want to know what came behind cms. I.e. if the URI is /cms/article/something.html I want to get access to "/article/something.html. If the URI is /cms/image/something.png I need to know the "/image/something.png }
The use case for this is a generic content controller that takes whatever URI that comes after /content/ and matches that to a content file that can be located at any folder depth with any file extension.
Thanks!
Thomas


Reply With Quote