鍐欏畬鍚庤皟璇曠殑榪囩▼涓紝鑰佹姤閿欙細java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream錛屽皯浜哻ommons-io.jar錛屽姞涓婂悗錛屽氨ok浜?br />
鍦–ontroller绔紝鍙互鐢ㄤ互涓嬫柟寮忓彇寰椾笂浼犵殑鏂囦歡錛屽彲浠ヤ笂浼犲涓枃浠訛細
聽public Set getMultipartFileForForm(HttpServletRequest req) {
聽聽MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) req;
聽聽// CommonsMultipartFile file = (CommonsMultipartFile)
聽聽// multipartRequest.getFile("attach");//attach涓篺orm涓篺ile鐨刬d鍊?br />聽聽// MultipartHttpServletRequest multipartRequest =
聽聽// (MultipartHttpServletRequest)request;
聽聽Set fileset = new LinkedHashSet();
聽聽for (Iterator it = multipartRequest.getFileNames(); it.hasNext();) {
聽聽聽String key = (String) it.next();
聽聽聽MultipartFile file = multipartRequest.getFile(key);
聽聽聽if (file.getOriginalFilename().length() > 0) {
聽聽聽聽fileset.add(file);
聽聽聽}
聽聽}
聽聽return fileset;
聽}