次のように書いているStrutsアクションがありHttpServletResponse
ます。コードは HTTP でのみ機能し、HTTPS では機能しません。
BufferedInputStream in = null;
try {
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\";");
// set response headers
response.setContentLength(fileData.length);
response.setContentType("application/octet-stream");
//BUFFER
int bufferSize = 2 * 1024 * 1024;
in = new BufferedInputStream(new ByteArrayInputStream(fileData), bufferSize);
byte[] buffer = new byte[bufferSize];
int len = 0;
// Loop through the input file and get the data chunks...
while ((len = in.read(buffer, 0, bufferSize)) != -1) {
response.getOutputStream().write(buffer, 0, len);
}
} catch (Exception e) {
throw new SystemException(e.getMessage());
} finally {
response.getOutputStream().flush();
response.getOutputStream().close();
}
サーバーは Weblogic 10 です (問題ありませんか?)。ファイルのダウンロードを除いて、Web アプリケーション全体が HTTPS で動作します。Chrome と FF では動作しますが、IE 8/9 では動作しません。警告ボックスに次のメッセージが表示されます
Windows は 'https://xxxxxxx' を見つけることができません