可能是没有加这个bean <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="defaultEncoding" value="utf-8"/> <property name="maxUploadSize" value="1000000"/> <property name="maxInMemorySize" value="1000000" /> </bean>
因为org.springframework.web.servlet.DispatcherServlet里需要
private MultipartResolver multipartResolver;