In Spring MVC 2.5 with Jetty – probably with any servlet container -, I want to redirect to an external site using RedirectView via the magic “redirect:” prefix for the view name in ModelAndView.
Unfortunately, RedirectView uses response.encodeRedirectURL(), so my (otherwiese wanted) session id is appended to the URL. It is not only a security risk to carry the session id to the external site, the “;jsessionid=gagnbaba” string may also be interpreted as part of the ContextPath/PathInfo on the other site, resulting in a bad URL.
Any “springish” options other than implement my own ExternalRedirectView… and also hack the ViewResolver to interpret a “externalRedirect:” prefix? (Requiring cookies is not an option.)
Moritz
Now here is ExternalRedirectView as planned in my comment above… did it that way.
I also already had my own ViewResolver in which I added the functionality for the new externalRedirect: magic vier name prefix, which now reads:
[…]
Thanks to everyone who read this and thought about it.