当我提交包含许多数据的表单时,出现错误“表单太大”。 JETTY 服务器的默认大小为 2 mb,超出了我的表单大小。
我通过在 Eclipse 中使用系统参数在本地解决了这个问题,即将最大表单内容设置为 -1,这意味着表单内容没有限制。但问题出在 UAT 环境中。如果我们不能使用 Eclipse,该怎么做?
有谁知道如何直接在 JETTY 或 TOMCAT 中提供此配置,以便最大表单内容不受限制。我在 JETTY 的 start.ini
文件中尝试了相同的配置,但它在 UAT 中不起作用。
请极客分享你的想法,如果有的话。 谢谢
最佳答案
无限的表单内容大小实际上是一种漏洞。 (研究映射散列键冲突如何成为严酷的 DOS 攻击形式)
您真的确定需要发送 2MB 的表单数据吗?
Note:
multipart/form-data
content that are FILES (not form fields) are handled with different max size configurations.Look into the
<multipart-config>
entries inWEB-INF/web.xml
or@MultiPartConfig
annotations for more about those limits.
关于eclipse - 如何在 jetty 或 tomcat 服务器中设置最大表单内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34241673/