Add a "return" statement after the sendRedirect call:

    sendRedirect("http://www.here.com/gohere.html");
    return ;

----- Original Message -----
From: Paul Allton <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 26, 1999 3:27 PM
Subject: Re: sendRedirect() / <jsp:forward.../> etc


> ----- Original Message -----
> From: Dion Almaer <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, October 26, 1999 4:45 PM
> Subject: sendRedirect() / <jsp:forward.../> etc
>
>
> > Hi,
> >
> > I noticed that when I do a sendRedirect() it doesn't jump on that ...
but
> > rather carries on processing untill its time to send back a response.
> >
> > So:
> >
> > sendRedirect("http://www.here.com/gohere.html");
> >
> > ...
> >
> > sendRedirect("http://www.here.com/gothere.html");
> >
> > would result in the page going to gothere.html.
> >
> > Is there a way to say 'ok right now send a redirect to X and don't
bother
> > processing anything else'?
>
> I'm using JHTML at the moment (the precursor to JSP) ... and its possible
to
> make the sendRedirect to action straight away .. so it should work the
same
> in JSP.
>
> Basically, directly after the sendRedirect do a "break;" ... some people
> will no doubt argue that this isnt terribly structured (and I'm one of
them)
> .. but it does work.
>
> The preferable solution would be to write code more carefully so that it
> naturally drops out without causing any ill effects.
>
>
>
> >
> > Does <jsp:forward /> do something like that?
> >
> > Thanks,
> >
> > Dion
> >
> >
> > --
> >          \\|//
> >          (o o)
> > +----oOOo-(_)-oOOo--------------------------------------------------+
> > |   [EMAIL PROTECTED]   | "Statistics show every two minutes          |
> > | www.almaer.com/dion |  another statistic is created."             |
> > +-------------------------------------------------------------------+
> >
> >
>
===========================================================================
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > FAQs on JSP can be found at:
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to