sendRedirect() sends a redirect response back to the client's browser. The browser will normally interpret this response by initiating a new request to the redirect URL given in the response.
forward() does not involve the client's browser. It just takes browser's current request, and hands it off to another servlet/jsp to handle. The client doesn't know that they're request is being handled by a different servlet/jsp than they originally called.
There are different situations where you want to use one or the other. For example, if you want to hide the fact that you're handling the browser request with multiple servlets/jsp, and all of the servlets/jsp are in the same web application, use forward() or include(). If you want the browser to initiate a new request to a different servlet/jsp, or if the servlet/jsp you want to forward to is not in the same web application, use sendRedirect().
Hi All, I think above question is very well answered. I have an additional question. If i want to use sendRedirect and want to pass some values to the new request then how do i go about it? Suppose i am inside an application (a.jsp) and from here i want to jump to b.jsp(that jsp is in another application) then using sendRedirect will make a new request and all the session and request variables will be lost. How can i handle this situation?