表单封装,在Action形参中使用VO和MultipartFile能自动接收,但现在整合了Shiro,request变成了ShiroHttpServletRequest,虽然可以将其转换成成MultipartFile,但要手工合成对象,手工接收文件,很不方便,该怎么搞?

解决方案 »

  1.   

    还不分享一下???
    Spring MVC配置文件中有如下内容,这个Bean虽然没有被其他Bean引用,但这个id就是要写,我之前手滑给删了。
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <property name="maxUploadSize" value="104857600"/>
    <property name="maxUploadSizePerFile" value="5242880"/>
    <property name="maxInMemorySize" value="4096"/>
    </bean>
      

  2.   

    还不分享一下???
    Spring MVC配置文件中有如下内容,这个Bean虽然没有被其他Bean引用,但这个id就是要写,我之前手滑给删了。
    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <property name="maxUploadSize" value="104857600"/>
    <property name="maxUploadSizePerFile" value="5242880"/>
    <property name="maxInMemorySize" value="4096"/>
    </bean>