问题:Request processing failed; nested exception is org.springframework.web.multipart.MultipartException

音讯 Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.IllegalStateException: 因为没有提供multi-part配置,无奈解决parts

形容 服务器遇到一个意外的状况,阻止它实现申请。

在application.xml配置文件中加上<multipart-config/>

<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"         version="4.0">    <servlet>        <servlet-name>dispatcher</servlet-name>        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>        <multipart-config/>        <init-param>            <param-name>contextConfigLocation</param-name>            <param-value>classpath:application.xml</param-value>        </init-param>    </servlet>    <servlet-mapping>        <servlet-name>dispatcher</servlet-name>        <url-pattern>/</url-pattern>    </servlet-mapping></web-app>