I'm trying to use different methodes depending on from which domain the request is send.
e.g.
@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 {
}
The two domains are routing to one, the same, server and webapp, but I'd like to return a different modelAndView in the controllerclass depending from which URL the reqeust is comming.
Any ideas?
cheers.
Can you not have a single handleRequest
method where you simply check HTTP referrer header and act correspondingly - fork into different methods, etc.?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With