sendRedirect

In send Redirect whenever the client makes any request it goes to the container, there the container decides whether the concerned servlet can handle the request or not.

sendRedirect

sendRedirect

     

In send Redirect whenever the client makes any request it goes to the container, there the container decides whether the concerned servlet can handle the request or not.   If not then the servlet decides that the request can be handle by other servlet or jsp. Then the servlet calls the sendRedirect() method of the response object and sends back the response to the browser along with the status code. Then the browser sees the status code and look for that servlet which can now handle the request.   Again the browser makes a new request, but with the name of that servlet which can now handle the request and the result will be displayed to you by the browser. The URL will have the address of the new servlet. In all this process the client is unaware of the processing.

Servlet Redirect forces the browser to do work.