The difference between forward and redirect?

The difference between forward and redirect?

 

Forward is the turn of control in the container. The server requests resources. The server directly accesses the URL of the target address, reads the response content of that URL, and then sends these contents to the browser.The browser does not know what the server sends. Where did the content come from, so its address bar is still the original address.

Redirect is that the server sends a status code according to the logic to tell the browser to request the address again.Generally, the browser will re-request with all the parameters just requested, so the
session and request parameters can be obtained, and from the browser. You can see the link address after the jump in the address bar. The former is more efficient, when the former can meet the needs, try to use the forward method, and this also helps to hide the actual link; in some cases, for example, if you need to jump to a resource on another server, you must use sendRedirect (method.
 

 

 

 

 

 

Published 13 original articles · Like 3 · Visits 4980

Guess you like

Origin blog.csdn.net/u010919402/article/details/105496319