JSP redirection: difference between response. sendredict and forward

Source: Internet
Author: User

A. jsp:

 
<% Response. sendredict (/test/B. jsp) system. Out. println ("test ");//CodeWill Execute %>

 
<JSP: Forward page = "B. jsp"/>

Sendredict Forward
Different Response Different Response, but B. jsp can get the parameters of A. jsp
After the switch, the code after the original sendredict will continue to be executed The statements after forward are not sent to the client.
Slow speed Fast
You can jump to any page, including the Internet, if you need a round-trip between the client and the server. Internal Server conversion, cannot be switched to Internet such as Sina
The address bar changes to B. jsp. The address bar has not changed.
You can pass the parameter B. jsp? Value = 1 You can pass the parameter B. jsp? Value = 1
/Represents the server address (http: // 127.0.0.1 /)
Response. sendredict ("/test/B. jsp ")
/Represents the address of the current page (http: // 127.0.0.1/test /)

Related Article

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.