I have 2 tomcat instances. both are behind apache proxies. my code in Spring controller is as follows:
@RequestMapping(value = "/doSuperSexyStuff", method = RequestMethod.GET) public String viewSuperSexyStuff() { return "redirect:/mySuperSexyStuff"; }
In my first tomcat installation on Windows, I have somedomain1.dev redirected to http://localhost:8080/myapp and everything works flawlessly. redirect goes to http://somedomain1.dev/mySuperSexyStuff
In another tomcat installation (which is on Linux) the redirection works relative to the context path, and the user ends up at http://somedomain2.dev/myapp/mySuperSexyStuff , which is obviously wrong.
What should I do for Spring to ignore the context path and simply redirect the user to where he "belongs"?
All the URLs in my application are absolute (everything including links in jsps, redirect URLs and all places where links are used). I guess that is not the right way to do things: if I need to implement the HTTPS version on the site, I will have problems. Therefore, if you think that I should change something in my approach, please point me in the right direction.
source share