【发布时间】:2011-06-15 08:43:34
【问题描述】:
我正在尝试使用不同的方法,具体取决于发送请求的域。
例如
@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 {
}
这两个域正在路由到同一个服务器和 webapp,但我想在控制器类中返回不同的 modelAndView,具体取决于请求来自哪个 URL。
有什么想法吗?
干杯。
【问题讨论】: