压缩两个文件到指定目录下,压缩成zip文件,要求用打开,保存的模式response给客户端。    public static void createZipFile(HttpServletResponse response) throws Exception {     String zipPath = "e:/zip/test.zip";
     List<String> filePaths = new ArrayList<String>();
     filePaths.add("e:/zip/aa.txt");
     filePaths.add("e:/zip/bb.txt");
    
    
        File zipFile = new File(zipPath);
         response.setContentType("application/octet-stream");
             response.setHeader("Content-Disposition", "attachment; filename=" + zipFile.getName());
            
             ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile));
             ZipOutputStream webZos = null;
             ServletOutputStream out = null;
                         try {
             out = response.getOutputStream();
              
               webZos = new ZipOutputStream(new BufferedOutputStream(out));
             for (String filePath : filePaths) {
                File file = new File(filePath);         
                ZipEntry ze = new ZipEntry(file.getName());
          zos.putNextEntry(ze);
         
          webZos.putNextEntry(ze);          InputStream is = new BufferedInputStream(new FileInputStream(file));
          byte[] buf = new byte[1024];
          for (;;) {
           int len = is.read(buf);
           if (len < 0) break;
           webZos.write(buf, 0, len);
           zos.write(buf, 0, len);
          }
          is.close();    
             }       
             } catch (Exception e) {
             throw e;
             } finally {
             webZos.close();
             zos.close();      
             }         }
压缩正常,生成的test。zip也正常,可response出来的是个错误文件,不知道哪个环节出了问题,xwb。xml里用配置吗