sendRedirect() results in the server sending a HTTP redirect response to the client saying "please, go to this URL" while forward() (also called "server-side forward") passes on the request processing responsibility to another resource such as a servlet or a JSP page.
What difference does it make?? means in sendRedirect will the code written after the command will execute or it will just redirect to the url specified from that point only without compiling the rest of the code.
Joined: Aug 19, 2003
If u use sendRedirect .. 1.A new request is forwarded to the destination page i.e., its a round the way trip means the source first redirects to the client i.e,the browser and then from the browser , the destination page is forwarded a request. 2.It is advisable to use these method when the control has to be forwarded to a page which is on a different server. If u use jsp:forward 1.The original request is forwarded to the destination page i.e, no new request object is created. 2.It is widely used when both the source as well as destination page reside in the same server.Thus this method is a whole server side process n no going back to browser. I hope this works out.