September 21, 2009 at 10:27 AM
the defference between send and redirect and forward of JSP is that
Forward: this is used to forward any new page within ur servers servlet or jsp. it may be server to server and server to client also.
send redirect: this is same as forward but its used only for forward from server to client that may be servlets and JSP also
September 21, 2009 at 11:19 AM
Difference between Redirect and Forward:
* In forward, the request is sent to another resource on the server, without the client being informed that a different resource is going to process the request while sendRedirect causes the web container to return to the browser indicating that a new URL should be requested.
* Forward is much faster in performance compared to sendRedirect.
* In forward the URI does not change while in sendRedirect, the URI is changed.
* Forward will not work in a different servlet context while Redirect works in both same/ as well as different contexts.
* Forward retains the request, but with redirect all request parameters are lost.
* The sendRedirect requires complete URI to process the request while only relative path is sufficient with Forward.