Is there a way to get the complete path value after the requestMapping
@PathVariable
values have been parsed?
That is:
/{id}/{restOfTheUrl}
should be able to parse /1/dir1/dir2/file.html
into id=1
and restOfTheUrl=/dir1/dir2/file.html
Any ideas would be appreciated.
Here is how I did it. You can see how I convert the requestedURI to a filesystem path (what this SO question is about). Bonus: and also how to respond with the file.
Just found that issue corresponding to my problem. Using HandlerMapping constants I was able to wrote a small utility for that purpose:
I have a similar problem and I resolved in this way:
Note that
req.getPathInfo()
will return the complete path (with{siteCode}
and{fileName}.{fileExtension}
) so you will have to process conveniently.