The rest of the code should execute normally after the forward.

It is my understanding that calling forward simply tags the HttpRequest 
object, telling the app server to forward it to the target servlet upon 
completetion of the code.

In fact if, in the doGet() method of Servlet0, you forward to Servlet1, and 
then (one line later), forward to Servlet2, the rest of the code in servlet0 
will execute, and the request will be forwarded to Servlet 2.

I haven't tried this, specifically in Tomcat, but that's the way it works in 
WebSphere...

Cheers,
E.


>From: "Dan Randall" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Forwarding in Tomcat
>Date: Tue, 08 May 2001 10:28:23 -0700
>
>Hi,
>
>Using tomcat as my servlet container, if I use the forward method of a 
>dispatcher object, say to forward an object attached to the HttpResponse to 
>a JSP, will code after the forward in the servlet be executed normally?  
>Will a try...finally insure that the remaining code is executed?  Is the 
>try finally necessary?  In a nutshell, I guess, does the forward method 
>permanently exit a servlet method such as doGet()?
>
>Thanks!
>
>Dan
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

Reply via email to