1.利用excel做成输出模板,保存时为HTML格式
2.在页面种增加
<%response.setContentType("application/vnd.ms-excel");%>
<%@ page contentType="application/vnd.ms-excel; charset=gb2312" %>3.默认文件名
<%
String filename=new String(("测试文件").getBytes("GBK"),"ISO-8859-1");
response.addHeader("Content-Disposition", "filename="+filename+".xls");
%>