tomcat7以上,ajax post参数后台获取不到的问题
2017-03-08 11:20
447 查看
AJAX post传参后台获取不到查询参数。
网上找了各种方法,包括设置content-type,又是把json转成json格式字符串,问题依然存在,但是把post改成get又可以获取到,百思不得其解。
后来看tomcat7配置的时候,把maxPostSize="0"的配置去掉的时候问题消失。
根据以往的经验,maxPostSize="0"不就是不限制post数据的大小的么,怎么还反倒限制了数据的大小了呢?
因为项目里面要post一个数据到后台保存(大小可能大于2M),所以这大小就不能限制。
再后来在tomcat的官方文档里发现了这个maxPostSize的变动。
tomcat6.0的文档里说maxPostSize不限制的设置是小于等于0
原话:The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The feature can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).
tomcat7.0的文档里面说maxPostSize不限制的设置是小于0
原话:The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than zero. If not specified, this attribute is set to 2097152 (2 megabytes). Note that the
所以把maxPostSize设置成“-1”,问题就得到了解决
网上找了各种方法,包括设置content-type,又是把json转成json格式字符串,问题依然存在,但是把post改成get又可以获取到,百思不得其解。
后来看tomcat7配置的时候,把maxPostSize="0"的配置去掉的时候问题消失。
根据以往的经验,maxPostSize="0"不就是不限制post数据的大小的么,怎么还反倒限制了数据的大小了呢?
因为项目里面要post一个数据到后台保存(大小可能大于2M),所以这大小就不能限制。
再后来在tomcat的官方文档里发现了这个maxPostSize的变动。
tomcat6.0的文档里说maxPostSize不限制的设置是小于等于0
原话:The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The feature can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).
tomcat7.0的文档里面说maxPostSize不限制的设置是小于0
原话:The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than zero. If not specified, this attribute is set to 2097152 (2 megabytes). Note that the
FailedRequestFiltercan be used to reject requests that exceed this limit.
所以把maxPostSize设置成“-1”,问题就得到了解决
相关文章推荐
- tomcat7以上,ajax post参数后台获取不到的问题,post参数大小不能大于2M的解决办法!
- tomcat7以上,设置maxPostSize="0"参数后台获取不到的问题
- tomcat7,ajax post参数后台获取不到的问题
- ajax的post请求后台request.getParameter()接收不到参数问题
- ajax post 后台request.getParameter获取不到参数
- ajax使用post提交参数java后台获取值为null但是get却可以获取的问题
- POST方法提交参数后台getparameter获取不到的问题!
- 解决angular的post请求后SpringMVC后台接收不到参数值问题的方法
- ajax post 提交中文java后台获取参数出现乱码解决方法
- jquery通过ajax-json访问java后台传递参数,通过request.getParameter获取不到参数的说明
- springMVC下ajax获取后台参数直接走错误或者报406错误问题解决
- 解决angular的$http.post()提交数据时后台接收不到参数值问题的方法
- ajax xmlhttprequest使用post传参数并向后台获取数据
- 解决angular的$http.post()提交数据时后台接收不到参数值问题的方法
- jquery通过ajax-json访问java后台传递参数,通过request.getParameter获取不到参数的说明
- 解决angular的post请求后SpringMVC后台接收不到参数值问题的方法
- jquery通过ajax-json访问java后台传递参数,通过request.getParameter获取不到参数的说明
- 用ajax post array数组到Mvc web Api后台接受不到的问题
- ajax上传文件后台获取不到问题
- 关于tomcat7 配置 maxPostSize="0" 时,后台无法接收前台参数的问题