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. The role of index Generally speaking, an index...
1. Business scenario introduction Suppose there i...
Table of contents Pygame functions used Creating ...
Table of contents 1. MySQL replication related co...
RULES can be used to control the style of the int...
watch : listen for data changes (change events of...
The first article on data backup and restoration ...
Installation Steps 1. Create a virtual machine 2....
This article example shares the specific code of ...
I was working on a pop-up ad recently. Since the d...
I'll record the problems I encountered during...
1: django-admin.py startproject project name 2: c...
Let’s learn together 1. Traditional methods Copy ...
This article example shares the specific code of ...
This article example shares the specific code of ...