Html 帖子中传递的最大参数数
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12277231/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Maximum number of parameter passed in a post
提问by Giant2
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?
我怎样才能在 JBoss 中扩展这个限制?
回答by Aaron Digulla
The number of parameters was limited in all web servers to plug the hashmap collision denial of service attack.
所有Web服务器中的参数数量都被限制以插入hashmap碰撞拒绝服务攻击。
You can raise the limit by adding the following system property to the configuration file (e.g. standalone.xml
):
您可以通过将以下系统属性添加到配置文件(例如standalone.xml
)来提高限制:
<property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT" value="10000"/>
(source)
(来源)
回答by bwt
Just in case : for a plain Tomcat the corresponding solution is to add :
以防万一:对于普通 Tomcat,相应的解决方案是添加:
org.apache.tomcat.util.http.Parameters.MAX_COUNT=10000
in catalina.properties
在 catalina.properties
回答by Trong-Hieu Tran
Yes, it is right! Mr Aaron Digulla had right answer!
But please attention that: in Jboss 7, please insert the line
是的,没错!Aaron Digulla 先生给出了正确的答案!
但请注意:在 Jboss 7 中,请插入行
<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:
<system-properties>
<property name="org.apache.tomcat.util.http.Parameters.MAX_COUNT"value="10000"/>
</system-properties>
在<extensions>
标签之后,如果不是 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>
回答by ?ɑ??????
Another way if you're using WildFly is edit the standalone.xml
file and add max-parameters
:
如果您使用 WildFly,另一种方法是编辑standalone.xml
文件并添加max-parameters
:
<http-listener name="default" socket-binding="http" max-parameters="2690"/>
<http-listener name="default" socket-binding="http" max-parameters="2690"/>
standalone.xml example:
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>
...
回答by codechefvaibhavkashyap
You need to paste the following snippet in your standalone.xml of Jboss 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>
Focus on HTTP Listener tag with max-parameter value is what make the difference. The Default value for this field is:-
专注于具有最大参数值的 HTTP 侦听器标记是有区别的。此字段的默认值为:-
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
这样做是作为对这里讨论的 hashmap 碰撞拒绝服务攻击的补救措施