Created
November 28, 2013 08:23
-
-
Save yongchun/7688767 to your computer and use it in GitHub Desktop.
JSP页面到处excel解决中文名乱码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HSSFWorkbook wb = getExcelData(ippes); | |
response.setContentType("application/octet-stream"); | |
if(StringUtils.isNotEmpty(timeSession)){ | |
startTimeStr = new Date(new Date().getTime()-24*60*60*1000); | |
endTimeStr = new Date(); | |
} | |
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("IP端口流量-from-" + sdf.format(startTimeStr) + "-to-" + sdf.format(endTimeStr) + ".xls","UTF-8") ); | |
wb.write(response.getOutputStream()); | |
response.getOutputStream().flush(); | |
response.getOutputStream().close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment