Redirect and forward __j2ee

Source: Internet
Author: User

Let's first take a look at the scope of the request, and when we ask for a resource, we create a request object that has a scope that is valid for the current request

Forwarding: simply to extend the scope of the current request to the page you are forwarding to, that is to say that these 2 pages share the request, the variables stored in the previous request will not be invalidated, like the two pages together, There is also a feature is that after the forwarding of the controller will not be forwarded to the page displayed in the address bar, such as I a page a.jsp, request parameters for p= "haha", after the controller c.action processing, turn to b.jsp, then you see the b.jsp page,

But now the address bar displays the address: http://localhost:8080/project name/c.action?p= "haha"

Redirect: The variables for previous request requests have all been invalidated and entered a new request.

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.