标签:
//Tomcat下需要这两个
//out.clear();
//out=pageContext.pushBody();
//weblogic下加上会报错
response.reset();// 清空输出流
java.util.Date date = new java.util.Date();
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyyMMdd_hhmmss");
response.setHeader("Content-disposition", "attachment; filename="+sdf.format(date)+".xls");// 设定输出文件头
response.setContentType("application/x-download");
标签:
原文地址:http://www.cnblogs.com/shunliu-java/p/4305657.html