springmvc.xml
<!-- 上传拦截,如最大上传值及最小上传值 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" >
<property name="maxUploadSize">
<value>104857600</value>
</property>
<property name="maxInMemorySize">
<value>4096</value>
</property>
<property name="defaultEncoding">
<value>utf-8</value>
</property>
</bean>
后台代码
@RequestMapping(value="/edit")
public ModelAndView edit(@RequestParam(value = "files", required = false) MultipartFile[] files, HttpServletRequest request) throws Exception{
logBefore(logger, "修改Contents");
if(!Jurisdiction.buttonJurisdiction(menuUrl, "edit")){return null;} //校验权限
ModelAndView mv = this.getModelAndView();
PageData pd = new PageData();
*MultipartHttpServletRequest request1 = (MultipartHttpServletRequest)request;*
pd = new PageData(request1);
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/15804.html