Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
260 views
in Technique[技术] by (71.8m points)

java - Form too Large Exception

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)......

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

Also I am using the code jettyServer.setAttribute("org.mortbay.jetty.Request.maxFormContentSize", 5000000);

But no result

Note:-I am using Jetty-6.1.0

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try setting System properties via 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

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>

Document

Version 7 or Higher

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).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...