Request Too Large in apache tomcat 8.5

I am having the error 'request too large' when submitting a post to the backend. When I add the attribute maxPostSize="4194304" in the connector inside the file server.xml the problem goes away. But I don't want to change the server.xml file, I want to change the file web.xml in WebContent/WEB-INF.

I tried using the following in the web.xml file:

<multipart-config>
  <file-size-threshold>0</file-size-threshold>
  <max-file-size>209715200</max-file-size>
  <max-request-size>209715200</max-request-size>
</multipart-config>

But it does not solve the problem.

Can someone tell me how to solve this by altering the web.xml file please?

I am using java servlet.



Read more here: https://stackoverflow.com/questions/66254171/request-too-large-in-apache-tomcat-8-5

Content Attribution

This content was originally published by John R. Daniel at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: