Increase HTTP Post maxPostSize in Spring Boot

后端 未结 14 2237
无人共我
无人共我 2020-11-28 06:48

I\'ve got a fairly simple Spring Boot web application, I have a single HTML page with a form with enctype=\"multipart/form-data\". I\'m getting this error:

14条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 07:21

    This worked for me with Tomcat 8

    MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
    ObjectName objectName = new ObjectName("Catalina:type=Connector,port=" + 8080);
    mbeanServer.setAttribute(objectName, new Attribute("maxPostSize", 100000000));
    

提交回复
热议问题