Jetty设置请求表单最大值

来源:互联网 发布:forest类似的软件 编辑:程序博客网 时间:2024/06/03 20:57

 

解决错误java.lang.IllegalStateException: Form too large270468>200000,取消表单最大值限制

 

1.      在jetty根目录/etc/jetty.xml中添加如下配置:

<Configure id="Server" class="org.eclipse.jetty.server.Server">

...

<Call class="java.lang.System"name="setProperty">

<Arg>org.eclipse.jetty.server.Request.maxFormContentSize</Arg>

<Arg> 0 </Arg>

</Call>

</Configure>

 

 

 

2.      修改jetty根目录/start.ini添加如下配置:(未测试)

-Dorg.eclipse.jetty.server.Request.maxFormContentSize=0

 

 

 

3. 在WEB-INF目录下添加jetty-web.xml 文件解决,文件内容如下:

<?xml version="1.0"?>

<!DOCTYPE Configure PUBLIC "-//MortBay Consulting//DTD Configure//EN"

"http://jetty.mortbay.org/configure.dtd">

<Configure id="WebAppContext"class="org.eclipse.jetty.webapp.WebAppContext">

<Set name="maxFormContentSize"type="int"> 0 </Set>

</Configure>

:当前测试的jetty9.19.3版本,由于jetty版本不同,当设的值为0不生效时,尝试设置-1

0 0
原创粉丝点击