1. Why set maxPostSize? The tomcat container has a limit on the size of the transmitted data. If a file exceeding this value is uploaded, an error will be reported, making the program unable to be used normally. 2. Setting method Find /conf/server.xml in the tomcat directory and add the maxPostSize parameter to it
The parameter value "-1" means no size limit. Not setting the maxPostSize parameter means using the default size, which is 2097152 bytes, or 2 megabytes. 3. Notes on setting values One thing to note is that when there is no limit on the size of transmitted data under different versions of Tomcat, the value of maxPostSize is not the same! Specific differences: Before tomcat7.0.63, setting maxPostSize to a value less than or equal to 0 means no limit In tomcat7.0.63 and later, setting maxPostSize to a value less than 0 indicates no limit If you set maxPostSize="0" after tomcat7.0.63, the transmitted data will not be obtained. 4. Official Documentation Attach tomcat changeLog
ps: Tomcat sets maxPostSize, causing Post request to fail question: I recently deployed a project using Tomcat version 7.0.82.0. I found that I couldn't log in. I found that the data from the front end could not be passed to the back end. Troubleshooting: Through the debug log, it was found that the backend did not receive the login data of the front-end user. After checking, it was found that Tomcat added the parameter maxPostSize=0 in server.xml. After deleting this parameter, it was found that the data was received. analyze: I searched for maxPostSize=0, which means that the post request has no size limit. After googling for a long time, I found that the meaning of the parameter maxPostSize has changed since apache-tomcat-7.0.63: If the value is set to 0, it means that the maximum POST value is 0. To have no limit on the POST size, you need to set the value to -1. , before this version, set to 0 to indicate no limit on the POST size. This is the end of this article about the problems and precautions of setting maxPostSize for Tomcat. For more information about setting maxPostSize for Tomcat, please search previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Vue+echarts realizes stacked bar chart
>>: Detailed tutorial on installing mysql 8.0.20 on CentOS7.8
## 1 I'm learning docker deployment recently,...
Table of contents Slow query basics: optimizing d...
Click here to return to the 123WORDPRESS.COM HTML ...
This article shares with you the graphic tutorial...
.imgbox{ width: 1200px; height: 612px; margin-rig...
Basic environment configuration Please purchase t...
Table of contents 1. Connection Management 2. Imp...
Table of contents 1. Constructors and instances 2...
The above article has temporarily concluded my int...
Table of contents 1. What is deconstruction? 2. A...
Preface Anyone who has learned JavaScript must be...
By right-clicking the source file, the following c...
Table of contents cluster Cluster Details Events ...
Find the problem I have been learning Django rece...
To be honest, this question involves a lot of cor...