Anurag Mishra
Anurag Mishra

Reputation: 113

Specify the maximum size of the request on Java Tomcat server

I am using a tomcat server and making POST requests to it. My requests are quite big in size, say up to 10 MB. Is there a way I can increase the max request size?

I am not sending files and it is not a multipart request. I have tried ways that have been discussed earlier but they have been not of much use to me.

Upvotes: 0

Views: 2226

Answers (1)

Sampisa
Sampisa

Reputation: 1583

If I have understood your request, what you need is to increase the default tomcat limits. You then have to open "server.xml" file in conf folder of Tomcat, then search for <Connector> element, and add/edit attribute "maxPostSize". Then restart tomcat.

E.g. this is one I use in a development environment:

<Connector port="8080" protocol="HTTP/1.1"
     URIEncoding="UTF-8"
     compression="on" 
     compressionMinSize="2048"
     connectionTimeout="20000"
     maxPostSize="52428800"
     redirectPort="8443" />

Hoping this can help.

Upvotes: 1

Related Questions