You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <Cr...@eng.sun.com> on 2000/08/02 18:54:11 UTC

Re: RESEND: Is it possible to send control back to 'ActionServlet' instead of to a JSP?

Shamdasani Nimmi-ANS004 wrote:

> Hi,
>
> I have a situation where from my 'LogonServlet',  depending on certain
> conditions, I want to either:
>
> Go to "Servlet1" which does some processing and forwards control to JSP1.
>
> or
>
> Go to "Servlet2" which does some processing and forwards control to JSP2.
>
> Since everything I feel should pass through the controller servlet, how do I
> send control from "LogonServlet" to go back to the 'ActionServlet' with all
> the parameters, e.g., the name of the next servlet, etc.
>

Are "servlet1" and "servlet2" actually separate servlets?  If so, you can use
RequestDispatcher.forward() to forward to them just like you can to a JSP page
(as long as they are in the same webapp--otherwise you will need to redirect and
pass the parameters yourself somehow).

> Nimmi Shamdasani

Craig