Actually the RequestDispatcher.forward and RequestDispatcher.include are just method calls to the other servlet.
Control is indeed returned to the line after this line once it completes. The body of the code after the forward will still be processed and any unhandled exceptions will be thrown to requesting servlet.
The control is absolutely returned. However, there are some restrictions on what you can do afterwards -- in particular, you can no longer write to the response (it is assumed that the forwarded-to servlet took care of that already), so the only prudent thing to do is "return". [ October 24, 2006: Message edited by: wise owen ]
No, String fwdPath = "/ServletB"; RequestDispatcher rd = request.getRequestDispatcher(fwdPath); works. There are 3 ways to get a RequestDispatcher. And by the way, i am not sure, but I think getNamedDispatcher is not at the exam. You should focus on the other 2 ways instead. Can someone confirm this ? [ October 24, 2006: Message edited by: Max Fernandes ]
subject: RequestDispatcher : content in the forwarding page.