You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Scott McCrory <sc...@mccrory.com> on 2001/06/14 13:46:44 UTC

Re: Problems with 'sendRedirect' ...

> 
>     I am making a JSP application under Turbine and I'm having problems
>     with
> response's sendRedirect method.
>     If an error occurs into a JSP then I want to do a sendRedirect to
>     another
> JSP wich will handle it. When I do this, without having writed anything
> to the output, I have an exception that says that someone else (
> Turbine ??? ) has used the output  and then I can't redirect". 
>     Well ... how can I solve the problem ...
> 
>     Another thing that I have tried is to use RunData.setRedirectUri,
>     but it seems to 
> don't do anything with JSP.

Would RequestDispatcher's forward method work for you?  I like it because 
it keeps the request object intact (as well as the session and anything 
attached to it) during the hand-off, but the down-side is that you can't 
pre-alter the request's contents (i.e. the HTTP parameters) without 
extending the class (can somebody tell me why the base class doesn't have 
those setters?!).  This is easy with sendRedirect because you can load the 
URL with your parameters ("/blah.jsp?option1=a&option2=b") but you're more 
limited with forward(String).  Something to consider...
   Scott



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org