How to pass more than two parameters to a JSP __js

Source: Internet
Author: User

There are two ways of passing the argument
One, get way:
In this way, the parameters are written in the URL, for example, if the target argument page is target.jsp, then it can be written in the URL:
Http://..../target.jsp? <Param1> = <value1> & <Param2> = <value2> ....
Multiple parameters can be passed.
In target.jsp, use Request.getparameter ("<ParamName>");
Second, post mode
This method is to pass the parameters in the <form> frame body. For example, if you need to pass parameters from source.jsp to target.jsp. So you need to write this in source.jsp:
.......
<form name= "Form1" action= "target.jsp" method= "POST" >
<input name= "<Param1>" value= "<value1>" type= "text" >
<input name= "<Param2>" value= "<value2>" type= "hidden" >
<!--the hidden type of the input tag, the input label is not displayed when the page is displayed, but the parameter is passed back to the action target page of the form, which may be useful for your reference-->
.....
</form>
Use Request.getparameter ("<ParamName>") at target.jsp end;

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.