How can a JSP page transmit a parameter from one page to another ?, Another jsp

Source: Internet
Author: User

How can a JSP page transmit a parameter from one page to another ?, Another jsp

(1 ). one is redirection jump, and the hyper-connection <a> is a redirection jump. In this way, the request object cannot be passed to the next page, and the request object obtained from the next page is a new object, instead of uploading data from the previous page, you will not be able to get the data from the previous page. if you want to jump through this method, you need to use

① <A href = "a. jsp? Parameter Name = parameter value "> ② use request. getParameter (" parameter name ") on the next page to get the value

(2) another type of jump is forwarding. This type of Jump request object is passed to the next page. You can use

① <Jsp: forward page = "/. jsp "/> // you can use request. the setAttribute () method is stored in the request object, and ② the request is used to go to the next page. getAttribute () gets the parameter.

The most obvious difference between the two methods is that when you redirect to. jsp to B. the address bar of the jsp page is. jsp changes to B. jsp; on the contrary, when you jump from. jsp to B. the address bar is still. jsp address

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.