If request URIs I can get are http://file/first_dir/second_dir/file.txt
, is there a way to put everything after http://file
into a variable/method argument like it is possible with @PathVariable
?
Asked
Active
Viewed 978 times
0

ps-aux
- 11,627
- 25
- 81
- 128
1 Answers
1
its a confusing URL, file is usually a protocol, so its easy to get confused. Anyways, the problem is that the path variable separator is set to "/" and you can't "beat" this with a regex inside a request mapping. So one way would be to go for a custom mapper, here's a DZone article describing a custom mapper for optional path variables
http://java.dzone.com/articles/spring-3-webmvc-optional-path
But if I were you, I would give this solution a try, Spring MVC Getting PathVariables containing dots and slashes it uses a regex inside a rewrite filter to catch a sequence, and posts it as a parameter. I think it can provide a viable solution for you

Community
- 1
- 1

Master Slave
- 27,771
- 4
- 57
- 55