Is there a way to get the complete path value after the requestMapping @PathVariable values have been parsed?
这就是:
/{id}/{restOfTheUrl}应该可以解析/1/dir1/dir2/file.html成id=1和restOfTheUrl=/dir1/dir2/file.html
任何想法,将不胜感激.
有没有一种方法可以计算Spring控制器中其余的URL部分?
即如果我的路线是/user/{userId}/*我可以获取userId参数和其余的URL?那个部分?
例如对于/user/1/this/is/a/path.html?a=b我应该得到
userId = 1和userUrl = /this/is/a/path.html?a=b
我已经看到了一些解决方案并做了一些谷歌搜索,但是它们似乎有些奇怪的方式(很可能是因为答案是针对较旧版本的Spring的),所以在较新的版本中,如何才能做到这一点呢? ?