形式太大异常 [英] Form too Large Exception

查看:132
本文介绍了形式太大异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用发布请求发送大文件时,系统显示异常:

When I send a large file using a post request the system shows an exception:

java.lang.IllegalStateException: Form too large1105723>200000
at org.mortbay.jetty.Request.extractParameters(Request.java:1404)
at org.mortbay.jetty.Request.getParameter(Request.java:749)......

当我在谷歌搜索帮助时,他们会提供一些帮助,例如,
webappcontext.setMaxFormContentSize(5000000);

When I search help for this in Google they give some help e.g., webappcontext.setMaxFormContentSize(5000000);

我正在使用此代码,但问题未解决

I am using this code but the problem is not solved

我也使用代码
jettyServer.setAttribute(org.mortbay.jetty.Request.maxFormContentSize,5000000);

但没有结果

注意: - 我正在使用Jetty-6.1.0

Note:-I am using Jetty-6.1.0

推荐答案

尝试通过 jetty.xml设置系统属性

    <Call class="java.lang.System" name="setProperty">
      <Arg>org.mortbay.jetty.Request.maxFormContentSize</Arg>
      <Arg>500000</Arg>
    </Call>

好的,你可以从你的网络应用程序配置它

ok you can configure it from your web app

在您的网络应用程序
中添加WEB-INF / jetty-web.xml文件并在该文件中配置参数:

Add WEB-INF/jetty-web.xml file in your web application and configure the parameter in that file:

  <?xml version="1.0"?>
  <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
  "http://jetty.mortbay.org/configure.dtd">

  <Configure id="WebAppContext" class="org.mortbay.jetty.webapp.WebAppContext">
          <Set name="maxFormContentSize" type="int">600000</Set>
  </Configure>

文档

从版本7开始,Jetty的类已经转移到另一个包中。你必须用 org.eclipse ... 替换 org.mortbay ... (感谢David的评论) 。

Since version 7, Jetty's classes have moved to a different package. You must replace org.mortbay... with org.eclipse... (Thanks to David for his comment).

这篇关于形式太大异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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