公司项目报错:
o.s.boot.web.support.ErrorPageFilter : Forwarding to error page from request [/information/edit] due to exception [Could not parse multipart servlet request; nested exception is java.lang.IllegalStateException: The multi-part request contained parameter data (excluding uploaded files) that exceeded the limit for maxPostSize set on the associated connector]
根据提示,修改maxpostsize 更改为0,设置后依旧还是不生效,怀疑开发那边有设置大小。查看后开发已经设置很大了,所以问题可能还是我这边的问题。
查询资料得知,tomcat7.0.63(包含)之后就不能用0表示,而是改为-1表示,我用的是8.0版本,故重新修改此值,问题解决。
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" minSpareThreads="30" maxSpareThreads="120" acceptCount="200" maxPostSize="-1" disableUploadTimeout="true" URIEncoding="UTF-8"/>