Forward is the server requesting resources. The server directly accesses the URL of the target address, reads the response content of that URL, and then sends the content to the browser. The browser does not know where the content sent by the server comes from, so it The address bar is still the original address.
Redirect means that the server sends a status code based on logic to tell the browser to request that address again. So the address bar shows the new URL.
(2). In terms of data sharing
forward: The forwarded page and the forwarded page can share the data in the request.
redirect: Data cannot be shared.
(3). From the point of use
forward: Generally used when the user logs in, forwarded to the corresponding module according to the role.
Redirect: Generally used to return to the main page and jump to other websites when the user logs out.