Martin Leboeuf wrote:
> Hi again !
>
> Thanks for the reply. But still :
>
> Kevin Jones wrote:
>
> > Wrong on both counts I'm afraid - the call can be forwarded to a resource,
> > whcih will typically be a servlet or a JSP, and the call will return to
> you.
> > You typically put a <code>return;</code> statement after the
> > RequestDispatcher call,
>
> OK for the fact that I must forward to a servlet (which includes a jsp
> page). But for the case of transfer of control, let me insist and ask why,
> in the book "Inside servlets" by D. R. Callaway it is said, on page 285,
> last paragraph, that :
>
> "Unlike the include() method, control will never return to the servlet
> that forwards the request. The forward() method passes all control to the
> delegate servlet which..."
>
Sounds like a question you might want to address to Mr. Callaway directly. From a
logical viewpoint, the statement accurately depicts what happens -- the calling
servlet delegates responsibility for creating this response to the called servlet.
At the Java code level, though, Java has nothing like C's "setjmp/longjmp"
mechanism, so control has to return from the forward call. The usual code
convention, as has been described, is to put a return statement after the forward
call.
One possible confusing factor is that JSP hides this from you -- the <jsp:forward>
element does not appear to come back to your page, because there is a "return"
built in to the implementation of this element.
>
> Thanks again for the help, Martin.
> [EMAIL PROTECTED]
>
Craig McClanahan
===========================================================================
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