tomcat7以上,设置maxPostSize="0"参数后台获取不到的问题
2017-12-20 14:13
1286 查看
遇到两次这个问题,记录一下。
登录的时候后台获取不到验证码,本地环境是tomcat7.32,服务器是tomcat7.82,一样的配置,本地没有发生这样的情况。查询资料发现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 theFailedRequestFilter can be used to reject requests that exceed this limit.
所以把maxPostSize设置成“-1”,问题就得到了解决
登录的时候后台获取不到验证码,本地环境是tomcat7.32,服务器是tomcat7.82,一样的配置,本地没有发生这样的情况。查询资料发现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 theFailedRequestFilter can be used to reject requests that exceed this limit.
所以把maxPostSize设置成“-1”,问题就得到了解决
相关文章推荐
- 关于tomcat7 配置 maxPostSize="0" 时,后台无法接收前台参数的问题
- tomcat7以上,ajax post参数后台获取不到的问题,post参数大小不能大于2M的解决办法!
- 关于tomcat Post 数据参数的问题 maxPostSize="0"
- tomcat7以上,ajax post参数后台获取不到的问题
- Tomcat 9 设置 maxPostSize="0" Post 请求丢失问题修复
- tomcat7,ajax post参数后台获取不到的问题
- 过滤器中处理multipart/form-data头部的post请求request.getParameter(")获取不到参数问题
- tomcat server.xml maxPostSize=0 导致 果post表单收不到参数解决方案
- POST方法提交参数后台getparameter获取不到的问题!
- tomcat8 maxPostSize="0" 不生效
- 解决$GLOBALS["HTTP_RAW_POST_DATA"]获取不到数据的问题
- 解决$GLOBALS["HTTP_RAW_POST_DATA"]获取不到数据的问题
- TextBox属性设置为只读后台获取不到值的问题
- form enctype:"multipart/form-data",method:"post" 提交表单,后台获取不到数据
- angular的$http.post()提交数据到Java后台接收不到参数值问题的解决方法
- 解决angular的$http.post()提交数据时后台接收不到参数值问题的方法
- textview中有很多行,我只让它显示三行,最后显示...,我设置了android:maxLines="3"和android:ellipsize="end",但出现的问题是只显示两行就显示“...”
- tomcat配置maxPostSize遇到的问题
- TextBox属性设置为只读后台获取不到值的问题
- 解决angular的post请求后SpringMVC后台接收不到参数值问题的方法