Re: Using Response.sendRedirect()

John Arockiaraj <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
Hi,

You can still manage the session while redirecting to another
resource(jsp/servlet/html)
on your server. HttpServletResponse.sendRedirect(...) can be considered as
another
client request via browser.

Note 1 : Using sendRedirect(), you can jump to even another domain.

                e.g., if www.yourhost.com is your domain, you can redirect to
                        www.myhost.com

Note 2 : Good coding practice is to call the 'encodeRedirectURL' method
before sending
the URL to the output stream:

        response.sendRedirect (response.encodeRedirectURL
("http://myhost/app/module"));
(This encoding is also useful in maintaining session in case yours is
cookie-based
or url-rewriting based session management)


HTH
John


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[email protected]]On Behalf Of raj
Sharma
Sent: Tuesday, June 10, 2003 7:26 PM
To: [email protected]
Subject: Using Response.sendRedirect()


Hi,

  Will the session variables be available in the page where I  send by
response.sendRedirect() to the other page?


Raj

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.