OutputStream os = response.getOutputStream();// 取得输出流
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition", "attachment;filename=student.xls");
OutputStream ouputStream = response.getOutputStream();
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition", "attachment;filename=student.xls");
OutputStream ouputStream = response.getOutputStream();
本文介绍了一种使用Java Servlet从Web应用程序导出数据到Excel的方法。具体步骤包括设置响应头信息以便浏览器正确处理文件下载,并通过OutputStream将数据写入到Excel文件中。
186

被折叠的 条评论
为什么被折叠?



