form表单中method的get和post区别
一、问题的提出 <form action ="getPostServlet/getPost.do?param4=param4" method="get" > <input type="hidden" name="param1" value="param1"> <input type="hidden" name="param2" value="param2"> <input type="text" name="param3" value="param3" readonly> <input type="submit" name=" button 1" value="submit"> </form> 注意到表单中action:getPostServlet/getPost.do?param4=param4 这个action带有一个参数param4, 如果用get方法提交,后台无法接收到这个参数; 如果用post方法提交,后台就可以接收到这个参数。 问题原因的简单解释: 用get方法提交的url显示如下: http:// localhost /mywebapp/getPostServlet/getPost.do?pram1=param1&pram2=param2&pram3=param3&button1=submit也就是说 method为get时action自己后边带的参数列表会被忽视 ,