Forwarding and redirection in Java
Forward:
Request.getrequestdispatcher ("success.jsp"). Forward (Request,response);
After the server component receives a user request. After it has been processed, it is passed to another component. The user's request code is not modified. A frame that is returned to a user, such as a home page, after each component has been processed.
User Request-----Server-------Component 1-------component 2-------> server-------User
(The request does not change)
Redirect:
Response.sendredirect ("success.jsp");
After the server component receives a user request. Modify user requests after processing. Returned to the user. This allows the user to use the request again passively using the new request. (redirect is usually to prevent users from submitting data after the point of browser refresh or point back to produce duplicate submissions)
User Request-----"server-------" component------> Server-------user-------"new request
(Modify user request)
Thank you for reading, I hope to help you, thank you for your support for this site!