ServletRequest.getParameter always returns null when the post size is big
We are maintaining a spring mvc (2.5.6) web application running on Tomcat 6.0.14
There is a bug in our app that caused one text field to increase its size resulting in a post of 3.000.000 bytes of text.
We will fix this bug, but what bothers me is that when the post size gets this big the method ServletRequest.getParameter
fails silently and returns null. There is no sign of any error on the logs.
Is this spring mvc fault?
Is this a tomcat misconfiguration?
Why can't I see any exception in the logs?
Is this spring mvc fault?
Is this a tomcat misconfiguration?
Neither. You are exceeding the default value of Tomcat's maxPostSize which is 2Mb.
Reference: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Common_Attributes
By the way, 6.0.14 is really old. You should upgrade to the latest (6.0.33 or 7.0.21) ASAP to get fixes for the recently reported denial of service flaw, and earlier security problems.
Well the default size for POST is 2MB in apache tomcat.
You can change the maxPostSize
parameter in the Connector
tag in the Tomcat's server.xml.
Refer:http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
精彩评论