首页 > 其他分享 >Expected MultipartHttpServletRequest: is a MultipartResolver configured方案。

Expected MultipartHttpServletRequest: is a MultipartResolver configured方案。

时间:2023-05-24 10:22:40浏览次数:44  
标签:MultipartResolver configured MultipartHttpServletRequest commons fileupload Expe

//1.报错:Expected MultipartHttpServletRequest: is a MultipartResolver configured  ?
//2.解决
<!-- uploadify文件上传组件 -->
<dependency>
    <groupId>commons-fileupload</groupId>
    <artifactId>commons-fileupload</artifactId>
    <version>1.3.1</version>
</dependency>
// spring中添加bean
<!-- 支持文件上传 -->
 <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    	 <!-- 请求编码格式 -->
    	 <property name="defaultEncoding" value="utf-8"></property>
    	 <!-- 上传文件大小(单位:字节) -->
         <property name="maxUploadSize" value="50000000"></property>
         <!-- 缓冲区大小(单位:KB) -->
         <property name="maxInMemorySize" value="1024"></property>
    </bean>

标签:MultipartResolver,configured,MultipartHttpServletRequest,commons,fileupload,Expe
From: https://www.cnblogs.com/jqccan/p/17427254.html

相关文章