错误信息
org.springframework.web.bind.annotation.support.HandlerMethodInvocationException: Failed to invoke handler method []; nested exception is java.lang.IllegalStateException: Current request is not of type [org.springframework.web.multipart.MultipartHttpServletRequest]: org.apache.catalina.connector.RequestFacade@39de5415
加入maven依赖
<dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3.1</version> </dependency>
Spring MVC 处理文件上传异常解析
本文探讨了在使用Spring MVC进行文件上传时遇到的HandlerMethodInvocationException异常,该异常通常由于请求不是MultipartHttpServletRequest类型导致。解决此问题需要确保配置正确,并引入commons-fileupload依赖。
1354

被折叠的 条评论
为什么被折叠?



