tags:

views:

97

answers:

2

Hello,

When I send The Large File By Using Post Request The System Shows The Exception is

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 i.e webappcontext.setMaxFormContentSize(5000000);

I am Using This code but The Problem Is Not Solved Please Give Me Some Help

And Also I am Use The Code jettyServer.setAttribute("org.mortbay.jetty.Request.maxFormContentSize", 5000000);

But No Result Please Give Me Some Help

Note:-I am Using Server Jetty-6.1.0 And I am Writing Code In Java

+1  A: 

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"&gt;

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

Document

org.life.java
Thanks For Writing Code But Their Is One Big Problem i.e We Doesn't Maintains The Server please Tell me Their is Another way To Do This
Narendra nnvd
@Narendra nnvd you deploy your app using maven plugin ?
org.life.java
I am Using The Server It Has Been Already Setuped We Doesn't Change the Xml File.
Narendra nnvd
@Narendra nnvd updated answer try that
org.life.java
Is Their Anyway To Do This Other Xml Files ? We Cann't Edit Jetty Xml Files Please Understand My Problem
Narendra nnvd
@Narendra nnvd No its just you need to add a config file in your web app , you won't touch the actual jetty's config file
org.life.java
Do i need to create jetty-web.xml file or need add it in web.xml file and will work without doing any extract modifications?
Narendra nnvd
@Narendra nnvd you need to add a new file check the documentation given
org.life.java
creating document with file name jetty-web.xml by using above code what ever you show and it places in Webapp/WEB-INF/ folder in my project. when i restart the my project.Still I got a exception
Narendra nnvd
i.e It is not working. Please give me another solution.
Narendra nnvd
@Narendra nnvd it should work recheck it also check this doc http://wiki.eclipse.org/Jetty/Reference/jetty-web.xml
org.life.java
A: 

I came across this problem too (running Jetty embedded in another application, so I'm not using jetty.xml).

I used the setMaxFormContentSize method on the ContextHandler class, which fixed the "form too large" exception. (See http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty#Setting_a_ServletContext for an example of creating/using a context handler).

Ash