淘先锋技术网

首页 1 2 3 4 5 6 7

uploadify Required MultipartFile parameter ‘uploadFiles’ is not present

使用springMVC+uploadify的时候出现错误
是因为没有定义配置文件的上传设置
首先要在web.xml中配置

 <!-- 配置中央控制器 -->
  <servlet>
    <servlet-name>dispatch</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:spring.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    <multipart-config>
      <max-file-size>512000000</max-file-size>
    </multipart-config>
  </servlet>

然后在MVC配置文件中配置


<bean id="multipartResolver"class="org.springframework.web.multipart.support.StandardServletMultipartResolver">
</bean>