| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | /** |
| | | * @Description: 表格工具类 |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | //response.setCharacterEncoding("UTF-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(),"ISO8859-1") + ".xls"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + ".xls"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | //不保存缓存信息与response.reset同样效果 |
| | | response.addHeader("Pragma", "no-cache"); |
| | | response.addHeader("Cache-Control", "no-cache"); |