"Notes in Java"------------------------the difference between forwarding and redirection in Java

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.