Re: Question about sendRedirect from HttpServletResponse

"Srinivasa Sai Chakravarthy V (CTC)" <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <44669B070CCED611A986000802807747053615E9@TCS01>
Hello,

I hope this answer works.

1.If SendRedirect is used the control will go to browser and get back to
server(So that's why it is temporary redirect response).So the it will slow
down the system by 2 times.It like a round trip.

2.There is no need to use the return. even though if return is used it won't
have any impact it will be returned after the roundtrip.

Thanks&Regards,
Chakri

> -----Original Message-----
> From: Mr. Cristian D. Romanescu [SMTP:[email protected]]
> Sent: Thursday, July 22, 2004 1:55 PM
> To:   [email protected]
> Subject:      Question about sendRedirect from HttpServletResponse
>
> Hello,
> I have two questions.
> In documentation of HttpServletResponse, for the method sendRedirect it
> says:
>
> "Sends a temporary redirect response to the client using the specified
> redirect location URL"
>
> 1. What does it means 'temporary'? Take this example:
> I have a login page which if user enters correct credentials i say
> sendRedirect('index.jsp') or else sendRedirect('login.jsp'). So if the
> user enters correct credentials is redirected to login. What does it
> means 'temporary' in this context? Is there any application state
> affected if I sendRedirect?
>
> 2. Is it necessary to enter after a sendRedirect() the 'return'
> statement? As in:
>
>         if ( login )
>         {
>                 sendRedirect('index.jsp');
>                 return;
>         }
>
> Because I saw it works with and without return.
>
> Thank you very much!
>
> Cristian.
>
> __________________________________________________________________________
> _
> 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.