Nil*_*ils 5 java dns url spring
我正在尝试使用不同的方法,具体取决于从哪个域发送请求。
例如
@RequestMapping(value = "/index.html", domain = "google.de", method = RequestMethod.GET)
public ModelAndView handleDeRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
}
@RequestMapping(value = "/index.html", domain = "google.com", method = RequestMethod.GET)
public ModelAndView handleComRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
}
Run Code Online (Sandbox Code Playgroud)
这两个域路由到相同的服务器和Web应用程序,但是我想根据需求来自哪个URL,在controller类中返回不同的modelAndView。
有任何想法吗?
干杯。
| 归档时间: |
|
| 查看次数: |
579 次 |
| 最近记录: |