org.apache.catalina.connector.RequestFacade cannot be cast to org.springframework.web.multipart

ajax提交,做文件上传时,由于上传的文件是另一台服务器,报错

MultipartHttpServletRequest multipartHttpServletRequest = (MultipartHttpServletRequest) request;

解决办法:

MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext());
        MultipartHttpServletRequest multipartRequest = resolver.resolveMultipart(request);

你可能感兴趣的:(org.apache.catalina.connector.RequestFacade cannot be cast to org.springframework.web.multipart)