Forwarding and redirection

Source: Internet
Author: User

Forwarding and redirection

I used a lot in writing servlet redirection and forwarding. I didn't quite understand the difference at the beginning, but it was important, so I had to memorize it. After many times of learning and exercises, I finally got a little understanding. If there is something wrong, everyone will study together.

ForwardingFor example, if there are three people A, B, and C, A will not ask B if there are any questions, and B will not ask B, but B will ask C and then tell. However, A does not know that B has asked C, but B has explained the question to himself.

RedirectionFor example, if there are three people A, B, and C, if A does not have A question, ask B. If B does not, directly tell A and C to answer this question, let A ask C. Therefore, A ran to ask C.

Difference between forwarding and redirection:

1. Forwarding is a server action, while redirection is a request sent from the client to the server again.

2. Duplicate refresh issues and data transmission, but not redirection. However, redirection can be redirected to other applications.

3. For the client, forwarding is a request that is processed multiple times, and redirection is a request of two times.

4. the URL of the browser address bar is the same during forwarding, while the address bar of the browser may be different during redirection.

5. Fast Forwarding and slow redirection

 

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.