servlet代码如下:String filename = file.getName();
//String ext = filename.substring(filename.lastIndexOf(".") + 1).toUpperCase();InputStream fis = new BufferedInputStream(new FileInputStream(filePath));
byte[] buffer = new byte[fis.available()];
fis.read(buffer);
fis.close();

resp.reset();
resp.setCharacterEncoding("utf-8");

//resp.setHeader("Expires", "0");
//resp.setHeader("Pragma", "public");
//resp.setHeader("Cache-Control", "public");
//resp.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0"); 
//resp.setHeader("Cache-Control", "cache, must-revalidate"); 
resp.setHeader("Content-Disposition","attachment;filename="+ new String(filename.getBytes("iso8859-1"),"utf-8"));

resp.setHeader("Content-Length", "" + file.length());
resp.setContentType("application/octet-stream");
//resp.setContentType("application/x-msdownload");
//resp.setContentType("application/x-download");
OutputStream os = new BufferedOutputStream(resp.getOutputStream());
os.write(buffer);
os.flush();
os.close();
如果用的是http的话就可以下载,但是用https就执行完servlet后就没弹出下载提示框,无法下载,注释的代码试过也没用。试过用重定向到"http://localhost:8080/MyServlet/DownloadServlet"也不行,因为是在别的平台上做二次开发,必须得用https,请问大家有没有什么办法?