Forwarding: 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. Frames that are returned to the user after each component finishes processing, such as the main page. 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. Processed to modify user requests. Returned to the user. This allows the user to use the request again passively using the new request. (redirection is generally done to prevent users from submitting data after the Point browser refreshes or after the point back to generate duplicate submissions) user requests -----server-------Components------> Server-------"user-------" new request (Modify user request)
*************************************************************************************************************** **
"Notes in Java"------------------------the difference between forwarding and redirection in Java