Large json/XML data POST unable to reach Tomcat server job

Nowadays it’s a common practice to use json or xml as data transfer between systems or say between a mobile app and the backend server. Well it happened a few days back that some of our POST data requests weren’t showing up on the backend for processing. It took a while for me to figure out that Tomcat has default maximum POST data size limits and anything over that gets rejected.

You can change the maxPostSize parameter in the HTTP Connector of the server.xml config. This parameter specifies the maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than zero. If not specified, this attribute is set to 2097152 (2 megabytes). Note that the FailedRequestFilter can be used to reject requests that exceed this limit.

Sample Connector Config with increased data size

   

Reference


1 comment:

Post a Comment

NO JUNK, Please try to keep this clean and related to the topic at hand.
Comments are for users to ask questions, collaborate or improve on existing.