Differences in Request redirection and request forwarding

Source: Internet
Author: User
1) forwarding can only send requests to components in the same web app, redirect resources that can be redirected to other applications on one site, and redirect resources to other sites using an absolute URL.

2) The path required for redirection is for the browser, that is, the relative URL begins with a "/", which is relative to the root of the entire Web site, and the path required for forwarding is relative to the server, that is, the relative URL begins with "/", which is relative to the root directory of the current Web application.

3) Redirect Browser address bar changes, the forwarding browser address bar does not change. This is because the redirect responds directly to the browser's request, and then allows the browser to access the address it gives, which forwards the browser's request to another resource, and the browser does not know what is going on inside the server program and waits only for the results of the program's response.

4) forwarding shares a request and a response object, which belong to the same access request and response process, and the redirect generates two request and response objects, which means that the server receives two requests in the process.

Differences in Request redirection and request forwarding

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.