RequestDispatcher forward and include methods
Hiren Dossani <[email protected]>
| Newsgroups | gmane.comp.java.sun.servlet |
|---|---|
| Message-ID | <[email protected]> |
afaik, forward method of RequestDispatcher transfers control to the forwarded servlet. means one can never come back to the fowarding servlet.
however, i don't get why the last statement in the following forwarding servlet was executed after using RequestDispatcher's forward method.
forwarding servlet code:
-------------------------
out.println("<font color=\"ff0000\"><h2>This text is from TallyPage1</font>\n<br><p>");
RequestDispatcher r = getServletContext().getNamedDispatcher("Tally");
r.forward(req, resp);
out.println("<font color=\"ff0000\"><h4>This line is after forward method</font>\n<br><p>");
forwarded servlet code:
----------------------
out.println("in forwarded servlet");
i shouln't see the last line in forwarding serlvet being displayed on the browser.
thanks for all your help.
--
hiren
___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html