问题:$.post 传参 参数过长导致后台接收为null
原因:这是由于 tomcat 设置导致。
根据官方文档http://tomcat.apache.org/tomcat-6.0-doc/config/http.html,在 tomcat 中有这样的设置:
server.xml文件
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000" redirectPort="8443" maxPostSize="-1" />
tomcat7.0.63之前(设置为0和负数均可以代表不限制):
tomcat7.0.63(包含)之后(不可以设置为0,只能是负数代表不限制):
解决方案: 将 maxPostSize 设置为 -1