java - Java Spring REST 全部捕获子 URL
问题描述
有人知道使用 Java Spring REST 捕获子 URL 的好解决方案吗?
例如,我有网址:
http://example.com/hauses/toll/country/usa? ...
http://example.com/hauses/small/country/germany? ...
http://example.com/hauses/underground/country/norway? ...
...
其中一个的解决方案将是这样的:
@RestController
@RequestMapping("/hauses/underground/country")
public class ProxyController {
@GetMapping("/norway")
public String readSalesOrder(HttpServletRequest request) {
some code
}
}
但我需要捕捉“/hauses”之后的所有内容。像这样的东西:
@RequestMapping("/hauses/*")
有人知道解决方案吗?
非常感谢您的帮助!
解决方案
推荐阅读
- c# - ASP.NET Framework v4 App using OpenIDConnect and Session[] variables will not authenticate the second session
- python - How to store a numpy.ndarray into MySQL?
- c# - 在 C# 中按两个属性对 JSON 数据进行分组
- java - URL truncated when it contains semicolons
- android - ListView - 使按钮 onClick 事件将值添加到同一行的 EditText
- python - Raspberry Pi 3:OpenCV 3.4.0 安装后缺少一些文件,无法在我的代码中调用
- javascript - 将字母分配给特定范围内的数值
- ldap - LDAP err32 on Jetty JAAS setting with Openldap
- linux - How to Do a For Loop Instead of a While Loop in Shell Scripting
- c - 将 execvp 与输入文件一起使用到程序并将输出重定向到新文件