RedirectView with cookie on response
I have a question about the return of a RedirectView
Consider the following example snippet, as part of a controller.
Code:
@Override
protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object o, BindException b) throws Exception {
Cookie c = new Cookie( "bar" , "foo" );
response.addCookie(c);
return new ModelAndView ( new RedirectView ( "otherpage.html" ) );
}
What happens to the cookie placed on the response.
Does the RedirectView offer the cookie to the browser, and then sends a redirect, or is the response ignored.
Thanks!