Issue of Get \post pass parameter in form action

Source: Internet
Author: User
Tags html header

<form action="servlet/thirdservlet?username=1&password=2"Method="Post">name<input type="text"Name="Uesrname"><br>Password<input type="text"Name="PassWord"><br> <input type="Submit"Value="Submit"> </form>
<form action= "servlet/thirdservlet?username=1&password=2" method= "POST" >name<input type= "text" name= "Uesrname" ><br>Password<input type= "text" name= "PassWord" ><br> <input type= "Submit" value= "Submit" > </form> Public voidDoPost (httpservletrequest request, httpservletresponse response)throwsservletexception, IOException {String userName= Request.getparameter ("UserName"); String PassWord= Request.getparameter ("PassWord"); Response.getwriter (). println ("UserName--->" +userName); Response.getwriter (). println ("PassWord---->" +PassWord); } 



&NBSP; the difference between get and post in form submission is 5 points

1.get is the data that is fetched from the server, and post is the data that is sent to the server.
2.get is to add the parameter data queue to the URL that the Action property of the submission form refers to, and the value corresponds to the field one by one in the form, as seen in the URL. Post is the httppost mechanism by which the fields within the form are placed within the HTML header with their contents and routed to the URL address referred to by the Action property. The user does not see the process.
3. For Get mode, The server side uses Request.QueryString to get the value of the variable, and for post, the server uses Request.Form to get the submitted data.
4.get the amount of data transferred is small and cannot be greater than 2KB. Post transmits a large amount of data, which is generally not restricted by default. In theory, however, the maximum amount of IIS4 is 100KB in 80KB,IIS5.
5.get security is very low and post security is high.

Problem with get \post passing parameters in form action

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.