Results 1 to 2 of 2

Thread: RedirectView with cookie on response

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Location
    Belgium
    Posts
    2

    Default 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!

  2. #2
    Join Date
    Sep 2010
    Location
    Belgium
    Posts
    2

    Default

    I found out that the cookie is stored first, before the redirect

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •