Definition
- Forward
The browser sends a request to the servlet A on the server, the servlet A forwards the request to the servlet B under the same server, and the servlet B responds back to the browser.
- Redirect
After the browser sends a request to server A, A will inform the browser to visit server B, the browser re-sends a new request to server B, and server B responds back to the browser.
Similarity
- The page will jump.
Differences
- Forward
Send the request once. After the page jumps, the url will not change.
- Redirect
Send the request twice. After the page jumps, the url will display the new address of the re-request.