Fabio Mancinelli wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 13 Mar 2003, Ian Hunter wrote:


Are you redirecting or forwarding to your JSP from that Action?


What is the exact difference between forwarding and redirecting? What are their implications?

I searched the Servlet and JSP specs but I haven't found nothing about that.

Forward <=> RequestDispatcher.forward() (http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/RequestDispatcher.html)

Redirect <=> HttpServletResponse.sendRedirect()
(http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServletResponse.html)

Big difference is that redirect sends an HTTP Response back the browser with a redirect header, generating a new request from the browser. This makes it in general slower and less efficient. Also, the Request object (and anything that you have shoved into it) is not preserved. On the other hand, redirect gives you control over the destination URL. Search the archives for full discussion.

hth,

Phil



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to