首页 > 代码库 > Expected MultipartHttpServletRequest: is a MultipartResolver configured

Expected MultipartHttpServletRequest: is a MultipartResolver configured

新增了一个表单上传功能

 

启动ide后,控制台报错

 

 

解决方案:

1.在spring_rest内增加

 

<!-- 支持上传文件 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>

 

2.将  Commons FileUpload jar包加入lib中。

 

报错 org.apache.commons.io.output.DeferredFileOutputStream

 

将CommonsIO jar加入lib。

 

Expected MultipartHttpServletRequest: is a MultipartResolver configured