We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用ajax,用Post向后台提交数据的时候,如果data太大,在后台获取data参数的时候会变成null。
POST请求本身并未限制传入参数大小,是tomcat 容器设置了接收参数大小的限制,默认限制为2097152bytes(2MB).
修改tomcat/conf/server.xml,在8080端口配置中加入maxPostSize="0"参数
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="2000" redirectPort="8443" URIEncoding="UTF-8" maxThreads="3000" compression="on" maxPostSize="0"/>
其中参数maxPostSize="10240"是限制post请求参数的大小,将值改为0代表不限制。 注意:maxPostSize参数只有当request的Content-Type为“application/x-www-form-urlencoded”时起作用。参考链接:http://stackoverflow.com/questions/7696197/tomcat-maxpostsize-value-ignored-with-xmlhttprequest
The text was updated successfully, but these errors were encountered:
现在好像是改成0不行了,最大改成-1可以
Sorry, something went wrong.
@wanglongbiao 请问你是用的哪个版本?
我查过资料了,Tomcat7 以后需要设置为 -1 才行
No branches or pull requests
问题描述:
使用ajax,用Post向后台提交数据的时候,如果data太大,在后台获取data参数的时候会变成null。
问题分析:
POST请求本身并未限制传入参数大小,是tomcat 容器设置了接收参数大小的限制,默认限制为2097152bytes(2MB).
解决方法:
修改tomcat/conf/server.xml,在8080端口配置中加入maxPostSize="0"参数
其中参数maxPostSize="10240"是限制post请求参数的大小,将值改为0代表不限制。
注意:maxPostSize参数只有当request的Content-Type为“application/x-www-form-urlencoded”时起作用。参考链接:http://stackoverflow.com/questions/7696197/tomcat-maxpostsize-value-ignored-with-xmlhttprequest
The text was updated successfully, but these errors were encountered: