tomcat配置参数实现前后端post请求参数无大小限制

tomcat部署下默认post请求提交参数大小为2M左右,超过这个大小,就会传值不成功

要使post请求参数无大小限制,需要在server.xml上修改,如下:
<Connector port="8080" protocol="HTTP/1.1" 
connectionTimeout="2000" 
redirectPort="8443" 
URIEncoding="UTF-8"
maxThreads="3000"
compression="on" compressableMimeType="text/html,text/xml" 
maxPostSize="-1"/>
<Connection port="8009" enableLookups="false" redirectPort="8443" debug="0" protocol="AJP/1.3" />

其中参数maxPostSize="-1"是限制post请求参数的大小,tomcat7.0.63之前的版本设置为0和负数均可以代表不限制。但是7.0.63之后的版本只有设置为负数才代表不限制数据大小

猜你喜欢

转载自blog.csdn.net/txp1993/article/details/87917485