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

查看:26
本文介绍了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")将返回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.

推荐答案

根据 this 对于您的 ,默认值为 2 MB.

As per this the default is 2 MB for your <Connector>.

maxPostSize = 容器 FORM URL 参数解析将处理的 POST 的最大大小(以字节为单位).可以通过将此属性设置为小于或等于 0 的值来禁用限制.如果未指定,则此属性设置为 2097152(2 兆字节).

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.在 元素中,添加属性 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.

话虽如此,如果是这个问题,你应该有一个例外在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天全站免登陆