You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter <pe...@ccs.neu.edu> on 2001/09/26 23:19:37 UTC
How exactly does a JSP response work?
Hi all,
I've run into a problem with JSPs. The problem appears to be that
I've been using the response.sendRedirect like a return statement meaning
that I don't expect any of the code following that to actually execute.
However it appears that the redirect only gets executed after all the code
is completed. So if anyone knows off hand how the response works please let
me know.
-Pete
Re: How exactly does a JSP response work?
Posted by "Craig R. McClanahan" <cr...@apache.org>.
The only way you can use response.sendRedirect() in a JSP page is inside a
scriptlet, right?
All the code in your scriptlet just gets copied into the source code of
the generated servlet. In a regular servlet, you would have to issue a
"return" statement after calling response.sendRedirect(), so you need to
do so in a JSP page as well.
Craig McClanahan
On Wed, 26 Sep 2001, Peter wrote:
> Date: Wed, 26 Sep 2001 17:19:37 -0400
> From: Peter <pe...@ccs.neu.edu>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: How exactly does a JSP response work?
>
> Hi all,
>
> I've run into a problem with JSPs. The problem appears to be that
> I've been using the response.sendRedirect like a return statement meaning
> that I don't expect any of the code following that to actually execute.
> However it appears that the redirect only gets executed after all the code
> is completed. So if anyone knows off hand how the response works please let
> me know.
> -Pete
>
>
>
>
>