POST参数内容是否有最大大小? [英] Is there a max size for POST parameter content?

查看:767
本文介绍了POST参数内容是否有最大大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在对使用HTTP POST和Servlet在两个系统之间发送XML的Java应用程序进行故障排除。我怀疑问题是XML的增长方式太大了。这可能是问题所在吗?是否有限制?

I'm troubleshooting a Java app where XML is sent between two systems using HTTP POST and Servlet. I suspect that the problem is that the XML is growing way too big. Is it possible that this is the problem? Is there a limit?

当它不起作用时, request.getParameter(message) on消费者方将返回null。这两个应用程序都在TomCat上运行。 ,例如,大小1.73MB的XML文档不会使它通过

When it doesn't work, the request.getParameter("message") on the consumer side will return null. Both apps are running on TomCat. For instance, an XML document of size 1.73mb will not make it through.

推荐答案

作为每个这个 < Connector>的默认值为2 MB

maxPostSize =最大,其中将由容器FORM URL参数解析处理的POST的字节大小。该限制可通过如果未指定,该属性被设置为2097152(2兆字节)设置此属性到小于或等于0的值被禁用。

maxPostSize = 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 or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).

编辑Tomcat的server.xml。在< Connector> 元素中,添加属性 maxPostSize 并设置更大的值(以字节为单位)以增加限制。

Edit Tomcat's server.xml. In the <Connector> element, add an attribute maxPostSize and set a larger value (in bytes) to increase the limit.

说完了,如果这是问题,你应该在
<$行上有例外c $ c>在tomcat中发布数据太大

Having said that, if this is the issue, you should have got an exception on the lines of Post data too big in tomcat

更多信息

这篇关于POST参数内容是否有最大大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆