浏览器在提交form表单时有两种提交方式
来源:互联网 发布:潍坊seo林晟科技 编辑:程序博客网 时间:2024/04/30 07:37
浏览器在提交form表单时有两种提交方式
一种是get方式,这也是默认的,到服务器端时就会调用处理get请求的doGet方法
而另一种是post方式,这需要在form表单中指定,即 method="post",服务器端会自动调用doPost方法来处理该请求。
而get请求和post请求的区别就是:
get请求在地址栏中以?分隔,后加传递的参数,这样传递的参数是有字符限制的。
post请求不显示参数。
在地址栏输地址按回车, 默认是get请求;
显示客户端的时间, 将javascript发到客户端即可;
<script language="javascript">
document.write(new Date());
</script>
想发post请求, 必须写form表单, method="post";
<form action="/myapp/basic/complex/time" method="post">
<input type="submit" value="see time">
</form>
以下是转的完整的:
doGet和doPost的区别,在什么时候调用,为什么有时doPost中套用doGet
1.提交的formmethod=Post 就执行doPost,否则执行doGet ,套用是不管method是post还是get都执行dopost方法
2.get:你可以通过URL传参数。http://www.csdn.net/index.asp?user=HelloWorld, Post 不行
3.你的表单提交都有方法的,如果提交为get就调用get方法,用post就调用post方法.
get 显示你传过去的参数,post则不显示.
5.通常的写法:先用doGet(),然后在doGet()中调用doPost(),这样就万无一失了
6.简单的说,get是通过httpheader 来传输数据,有数量限制,而post则是通过httpbody 来传输数据,没有数量限制。
7.还有一点:get和post提交的数据量是不一样的.
get 好像最多只能在url后跟64K(?具体多少忘记了),
post 好像没这个限制,至少我post过5M以上的文本
还有url刷新时get好像可以不用重复提交原来提交的数据,
而post则会说内容已提交,想刷新请再提交.Parameters:
一种是get方式,这也是默认的,到服务器端时就会调用处理get请求的doGet方法
而另一种是post方式,这需要在form表单中指定,即 method="post",服务器端会自动调用doPost方法来处理该请求。
而get请求和post请求的区别就是:
get请求在地址栏中以?分隔,后加传递的参数,这样传递的参数是有字符限制的。
post请求不显示参数。
在地址栏输地址按回车, 默认是get请求;
显示客户端的时间, 将javascript发到客户端即可;
<script language="javascript">
document.write(new Date());
</script>
想发post请求, 必须写form表单, method="post";
<form action="/myapp/basic/complex/time" method="post">
<input type="submit" value="see time">
</form>
以下是转的完整的:
1.提交的form
2.get:你可以通过URL传参数。http://www.csdn.net/index.asp?user=HelloWorld
3.你的表单提交都有方法的,如果提交为get就调用get方法,用post就调用post方法.
5.通常的写法:先用doGet(),然后在doGet()中调用doPost(),这样就万无一失了
6.简单的说,get是通过http
7.还有一点:get和post提交的数据量是不一样的.
req
- the HttpServletRequest
object that contains the request the client made of the servletresp
- the HttpServletResponse
object that contains the response the servlet returns to the clientprotected void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException,java.io.IOException
Called by the server (via the service method) to allow a servlet to handle a POST request.The HTTP POST method allows the client to send data of unlimited length to the Web server a single time and is useful when posting information such as credit card numbers.
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException,java.io.IOException
Called by the server (via the service method) to allow a servlet to handle a GET request.
Overriding this method to support a GET request also automatically supports an HTTP HEAD request.A HEAD request is a GET request that returns no body in the response, only the request header fields.
- 浏览器在提交form表单时有两种提交方式
- easyui form 表单提交两种方式
- Form表单提交的两种方式
- form表单的两种提交方式
- form表单提交两种方式
- form表单提交的两种方式
- form表单提交的两种方式
- form表单两种提交方式的区别
- 用超链接提交form表单的两种方式
- Form表单中数据的两种提交方式
- 网页表单form中提交的两种方式
- Ajax提交Form表单的两种简单方式
- form表单提交的两种方式在springmvc框架中的差异分析
- form 表单提交方式
- Form表单提交方式
- form表单提交方式
- form表单提交方式
- form表单提交方式
- GDI+ 双缓冲 画出来的透明图片是黑色的
- 带dos调试窗口的win32程序
- 转载:JVM监控命令
- 从零开始学.net多线程系列(三)——同步
- Training3:递归和栈编程训练
- 浏览器在提交form表单时有两种提交方式
- struts2常用标签
- 从零开始学.net多线程系列(一)
- VC数据类型
- 关于 “ 非法的变量名/编号”
- VC++中SetTimer的使用
- terracotta 介绍(来自百度)
- Altium Designer解决failed to add class member及Unknown Pin的问题
- 从零开始学.net多线程系列(二)