Html post中传递的最大参数数

Html post中传递的最大参数数,html,jboss,Html,Jboss,我得到这个错误: Exception during request processing: Caused by javax.servlet.ServletException with message: "Parameter count exceeded allowed maximum: 512" 在post中传递的参数数量似乎有限制 如何在JBoss中扩展此限制 所有web服务器中的参数数量都受到限制,无法插入 您可以通过将以下系统属性添加到配置文件(例如,standalone.xml)来提高

我得到这个错误:

Exception during request processing:
Caused by javax.servlet.ServletException with message:
"Parameter count exceeded allowed maximum: 512"
在post中传递的参数数量似乎有限制


如何在JBoss中扩展此限制

所有web服务器中的参数数量都受到限制,无法插入

您可以通过将以下系统属性添加到配置文件(例如,
standalone.xml
)来提高限制:



是的,没错!Aaron Digulla先生的答案是正确的
但是请注意:在JBoss7中,请插入行




标记之后,如果不是Jboss 7,则在解析standalone.xml时会出现错误,让我举个例子:

<?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>

...

以防万一:对于普通Tomcat,相应的解决方案是添加:

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

catalina.properties

中,如果使用WildFly,另一种方法是编辑
standalone.xml
文件并添加
最大参数

standalone.xml示例:

...

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

...
。。。
...

您需要将以下代码片段粘贴到Jboss服务器的standalone.xml中:

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

这是针对hashmap冲突拒绝服务攻击的补救措施,如前所述

问题已在serverfault:上得到回答。另外,这个问题与Java无关(也与您发布的技术堆栈无关)。那么我为什么会犯这个错误呢?请求处理期间出现异常:由javax.servlet.ServletException引起,消息为:“参数计数超出了允许的最大值:512”。我使用JBoss7,需要将我的应用程序部署到其他应用程序上。。。那么如何解决呢@Luiggi Mendoza在您链接的帖子中对此没有回答@Giant2:请在将来的问题中包含这些重要信息。是的,我以前也尝试过这样做,所以我只是在评论中发布链接来引导OP找到答案。@Luiggmendoza:我对你的评论投了赞成票;但在这种情况下,我真的觉得你应该发布一个答案。谢谢@Aaron Digulla,我以前看过这个帖子。使用Jboss(任何版本)如何修复512的限制?TxSo有一个限制(出于安全原因),我同意。非常感谢@Aaron Digulla。我可以在web.xml中使用它吗?如果可以,那么怎么做?我使用的是Tomcat 6,在catalina.properties中没有这个参数。我仍然可以发布600多个参数,而不会发生此错误。我将这一行添加到catalina.properties
org.apache.tomcat.util.http.Parameters.MAX_COUNT=100
,因为我想模拟这个错误。重新启动Tomcat,但我仍然可以发布600多个post参数。如何在Tomcat 6中模拟此错误?我没有
standalone.xml
,但是
web.xml
,如何在
Grails
项目中设置最大计数?你能帮我一下吗?我没有standalone.xml,但是web.xml,我如何在Grails项目中设置MAX_COUNT?
<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>
org.apache.tomcat.util.http.Parameters.MAX_COUNT=1000