Tomcat HTTP – Maximum URL Length in Tomcat

httprfctomcaturi

And is it configurable? Can I set up Tomcat so that a URL with, say, 200K of query params goes through successfully to the contained servlet?

Yes, I know one should use POST when you have lots of data; that's a less pleasant option in this particular case. The contained application (a search engine) expects a GET request to perform a search.

Best Answer

You can edit tomcat/conf/server.xml's HTTP/1.1 Connector entry, and add a maxHttpHeaderSize="65536" to increase from the default maximum of 8K or so, to 64K. I imagine that you could up this number as high as necessary, but 64K suffices for my needs at the moment so I haven't tried it.

<Connector port="8080" maxHttpHeaderSize="65536" protocol="HTTP/1.1" ... />