以流的形式将文件写入页面,直接下载
2016-08-30 10:41
218 查看
try {
OutputStream out = response.getOutputStream();
response.reset();
response.setHeader("content-disposition",
"attachment;filename="+java.net.URLEncoder.encode(reportName,"UTF-8")+".xls");
response.setContentType("APPLICATION/msexcel");
wb.write(out);
out.close();
} catch (FileNotFoundException e) {
throw new DAOException("");
} catch (IOException e) {
throw new DAOException("");
}
OutputStream out = response.getOutputStream();
response.reset();
response.setHeader("content-disposition",
"attachment;filename="+java.net.URLEncoder.encode(reportName,"UTF-8")+".xls");
response.setContentType("APPLICATION/msexcel");
wb.write(out);
out.close();
} catch (FileNotFoundException e) {
throw new DAOException("");
} catch (IOException e) {
throw new DAOException("");
}
相关文章推荐
- 以流的形式将文件写入页面,直接下载
- 以流的形式将文件写入页面,直接下载
- 感悟:安全创业商业模式及产品方向
- delphi资源文件制作及使用详解
- 以流的形式将文件写入页面,直接下载
- 以流的形式将文件写入页面,直接下载
- 以流的形式将文件写入页面,直接下载
- 以流的形式将文件写入页面,直接下载
- zabbix 邮件报错 Support for SMTP authentication was not compiled in
- 多线程异步处理示例
- 以流的形式将文件写入页面,直接下载
- 以流的形式将文件写入页面,直接下载
- 多线程异步处理示例
- 多线程异步处理示例
- 多线程异步处理示例
- 多线程异步处理示例
- zabbix 邮件报错 Support for SMTP authentication was not compiled in
- appium环境搭建
- gulp常用插件
- iOS btn实现collectionView方法