[spring] 使用spring上传时要添加BEAN:“multipartResolver”

<bean id="multipartResolver"

class="org.springframework.web.multipart.commons.CommonsMultipartResolver">

</bean>

否则,执行

MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;

会报 ClassCastException异常

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.