Maximum number of parameter passed in a post

I get this error:

Exception during request processing:
Caused by javax.servlet.ServletException with message:
"Parameter count exceeded allowed maximum: 512"

There seems to be a limit on the number of parameter passed in a post.

How could I extend this limit in JBoss?

Answers


The number of parameters was limited in all web servers to plug the hashmap collision denial of service attack.

You can raise the limit by adding the following system property to the configuration file (e.g. standalone.xml):

<property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT" value="10000"/>

(source)


Just in case : for a plain Tomcat the corresponding solution is to add :

org.apache.tomcat.util.http.Parameters.MAX_COUNT=10000

in catalina.properties


Yes, it is right! Mr Aaron Digulla had right answer! But please attention that: in Jboss 7, please insert the line

<system-properties> <property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT"value="10000"/> </system-properties> right after the <extensions> tag, if not Jboss 7 will through error when parse standalone.xml, let me example:

<?xml version='1.0' encoding='UTF-8'?>
<server xmlns="urn:jboss:domain:1.2">
<extensions>
    <extension module="org.jboss.as.clustering.infinispan"/>
    <extension module="org.jboss.as.configadmin"/>
    ...
</extensions>
<system-properties>
    <property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT" value="10000" />
</system-properties>

Another way if you're using WildFly is edit the standalone.xml file and add max-parameters:

<http-listener name="default" socket-binding="http" max-parameters="2690"/>

standalone.xml example:

...

<subsystem xmlns="urn:jboss:domain:undertow:1.1">
   <buffer-cache name="default"/>
   <server name="default-server">
       <!-- change here-->
       <http-listener name="default" socket-binding="http" max-parameters="2690"/>
       <!-- change here-->
       <host name="default-host" alias="localhost">
           <location name="/" handler="welcome-content"/>
           <filter-ref name="server-header"/>
           <filter-ref name="x-powered-by-header"/>
       </host>
    </server>

...

You need to paste the following snippet in your standalone.xml of Jboss server :

<server name="default-server">
                <http-listener name="default" socket-binding="http" max-parameters="5000"/>
                <https-listener name="https" socket-binding="https" max-parameters="5000"/>
                <host name="default-host" alias="localhost">
                    <location name="/" handler="welcome-content"/>
                    <filter-ref name="server-header"/>
                    <filter-ref name="x-powered-by-header"/>
                    <http-invoker security-realm="ApplicationRealm"/>
                </host>

Focus on HTTP Listener tag with max-parameter value is what make the difference. The Default value for this field is:-

org.apache.tomcat.util.http.Parameters.MAX_COUNT=1000

This was done as a remedy to the hashmap collision denial of service attack as discussed here


Need Your Help

What is a callback function and how do I use it with OOP

php oop dom callback function-calls

I want to use the php simple HTML DOM parser to grab the image, title, date, and description from each article on a page full of articles. When looking at the API I notice it has a set_callback which

Sorting a List<int>

c# linq list

Using C# what is the best way to sort a List numerically?