jsp导出简单的excel

在jsp中加入以下代码即可

 

<%
String fileName = "导出excel.xls";
fileName = new String(fileName.getBytes("GBK"),"ISO8859_1");
response.setHeader("Content-Disposition",
"attachment;filename="+fileName);

response.setDateHeader("Expires", 0);
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");
%>

posted @ 2016-10-10 13:41  江山一族  阅读(209)  评论(0编辑  收藏  举报