fileupload插件调用upload.parseRequest(request)解析得到空值问题

得到的list长度是0,项目配置不能改变,没办法了,只能将HttpServletRequest强换成DefaultMultipartHttpServletRequest ,直接获取表单中的字段了。方法很low,还是解决了自己的问题

DefaultMultipartHttpServletRequest httpServletRequest = (DefaultMultipartHttpServletRequest) request;
MultipartFile multipartFile = httpServletRequest.getFile("file");
String Id = httpServletRequest.getParameter("Id");

 

posted @ 2019-07-18 11:24  y-xs  阅读(3538)  评论(0编辑  收藏  举报