Anand Kumar Sankaran wrote:
> What actually is calling another JSP page?
>
> If you want to do a redirection do response.sendRedirect ("Absolute URL")
A sendRedirect causes an additional round trip to the client browser, while the
"callPage" method (JSP 0.9x) does the transfer on the server side, without any
involvement on the client's part. Thus, it will be faster.
You would use it when you decided that a different page should be displayed, instead
of the current one. For example, you could use the absence of a particular user
object in the session as an indicator that the user's session timed out (or they
never had one), and forward control to a login page to ask for their username and
password.
>
> If you want to simply include another JSP page, the 1.0 spec suggests usage of
>
> <jsp:include page=... />
>
The <jsp:include> mechanism effectively does a server-side-include operation,
including the output generated by another page into yours. The JSP replacement for
callPage() is actually <jsp:forward page="xxxxx" />
Note that you can forward to another JSP page, or to a servlet. Also, a servlet can
forward to a JSP page by using the RequestDispatcher.forward() mechanism.
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