Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Jetty/Howto/Configure Form Size"
Line 3: | Line 3: | ||
|introduction = | |introduction = | ||
− | {{Jetty | + | {{Jetty Redirect|http://www.eclipse.org/jetty/documentation/current/setting-form-size.html}} |
Jetty limits the amount of data that can post back from a browser or other client to the server. This helps protect the server against denial of service attacks by malicious clients sending huge amounts of data. The default maximum size Jetty permits is 200000 bytes. You can change this default for a particular webapp, for all webapps on a particular Server instance, or all webapps within the same JVM. | Jetty limits the amount of data that can post back from a browser or other client to the server. This helps protect the server against denial of service attacks by malicious clients sending huge amounts of data. The default maximum size Jetty permits is 200000 bytes. You can change this default for a particular webapp, for all webapps on a particular Server instance, or all webapps within the same JVM. |
Latest revision as of 18:46, 30 April 2013
Contents
Introduction
Jetty limits the amount of data that can post back from a browser or other client to the server. This helps protect the server against denial of service attacks by malicious clients sending huge amounts of data. The default maximum size Jetty permits is 200000 bytes. You can change this default for a particular webapp, for all webapps on a particular Server instance, or all webapps within the same JVM.
Changing the Maximum Form Size for a Single Webapp
The method to invoke is:
ContextHandler.setMaxFormContentSize(int maxSize);
You can do this either in a context XML deployment descriptor external to the webapp, or in a jetty-web.xml file in the webapp's WEB-INF directory.
In either case the syntax of the XML file is the same:
<Configure class="org.eclipse.jetty.webapp.WebAppContext"> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Max Form Size --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <Set name="maxFormContentSize">200000</Set> </Configure>
Changing the Maximum Form Size for All Apps on a Server
Set an attribute on the Server instance for which you want to modify the maximum form content size:
<configure class="org.eclipse.jetty.server.Server"> <Call name="setAttribute"> <Arg>org.eclipse.jetty.server.Request.maxFormContentSize</Arg> <Arg>200000</Arg> </Call> </configure>
Changing the Maximum Form Size for All Apps in the JVM
Use the system property "org.eclipse.jetty.server.Request.maxFormContentSize".