jetty上传 Form too large: 275782 > 200000

1,找到jetty服务器下的jetty.xml,在

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

</Configure>

中加入如下片段,调整数值。设置为-1时,表示不限制大小。

<Call name="setAttribute"> <Arg>org.eclipse.jetty.server.Request.maxFormContentSize</Arg> <Arg><Property name="jetty.maxFormContentSize" default="1000000"/></Arg> </Call>

 

2,jetty9的解决办法

修改pom.xml

<plugin>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <version>9.2.3.v20140905</version>
  <configuration>
    <jettyXml>
      src/main/resources/jetty/jetty.xml
    </jettyXml>
  </configuration>
</plugin>

添加一个文件到classpath即可

<Configure id="Server" class="org.eclipse.jetty.server.Server">
  <Call name="setAttribute">
    <Arg>org.eclipse.jetty.server.Request.maxFormContentSize</Arg>
    <Arg>-1</Arg>
  </Call>
</Configure>

 

posted @ 2016-11-17 15:43  pautcher  阅读(1273)  评论(0编辑  收藏  举报