Problem passing parameters in form action

Source: Internet
Author: User
Tags button type html header
I made a form in which it was written:

<form action= "orderitem.action?orderidz=1" method= "Get" >
<table cellpadding= "0" cellspacing= "0" border= "1px" >
<tr>
<th width= ">orderid</th><th" width= ">amount</th><th width=" > Operation </th ><th width= "><a" href= "addorder.action" > Add </a></th>
</tr>
<s:iterator value= "DataList" >
<tr onclick= "OrderItem (' <s:property value= ' orderId '/> ')" >
<td><s:property value= "orderId"/></td><td><s:property value= "Amount"/></td>
</tr>
</s:iterator>
</table>
<button type= "Submit" >go</button>
</form>

Then I was in the background to fetch Orderidz always can't get, and then check the internet I added in the form of the method= "post" in the background to obtain the use of:


HttpServletRequest request= servletactioncontext.getrequest ();

String roleid=request.getparameter ("Orderidz");

You can take it.

Check the reason:

the difference between get and post methods in form submission is 5 points

1.get gets the data from the server, and the post is to transfer the data to the server.
2.get is to add the parameter data queue to the URL that refers to the action attribute of the submission form, and the value corresponds to each field one by one in the form, as you can see in the URL. Post is the httppost mechanism by which each field in the form is placed with its contents in the HTML header and routed to the URL address referred to by the action attribute. This process is not visible to the user.
3. For Get way, server end uses Request.QueryString to obtain variable value, for post way, server end uses Request.Form to obtain the submitted data.
4.get transmits a small amount of data, not greater than 2KB. Post transfers have a large amount of data, which is generally default to unrestricted. In theory, however, the maximum number of IIS4 is 100KB in 80KB,IIS5.
5.get security is very low and post security is high.

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.