Sevlet response There is a way to redirect us to introduce you first.
The Sendredirect (String Local) method of a 1.HttpServletResponse object is called a redirect. If the location address is preceded by a
"/" means a request is made relative to the root of the servlet container, i.e. http://localhost:8080, if the location address money does not add "/", then the address is found relative to the URL of the current request.
The forward (request, response) of 2.RequestDispatcher is called forward forwarding .
3.
The essential difference between request forwarding and request redirection is whether to end a request cycle, and the resulting new requests
1) Request forwarding, the entire process is in the same request.
2) redirect, actually the viewer will send two requests like a server.
3) Requestdispatch is obtained by means of the Getrequestdispatch () method of the HttpServlet object, which is the method that belongs to the request object.
4) Sendredirect is the method of the HttpServletResponse object, that is, the method of the response object, since the method of the response object is called, it indicates that the entire request process has ended, the server began to want the client to return the results of execution.
5) redirect in Firebug
JAVA WEB: The difference between request forwarding and redirection