导出文件名乱码解决方案:
1 String agent = request.getHeader("User-Agent");
2 boolean isMSIE = (agent != null && agent.indexOf("MSIE") != -1);
3 if( isMSIE ){
4 finalFileName = java.net.URLEncoder.encode(exportFileName,"UTF8");
5 }else{
6 finalFileName = new String(exportFileName.getBytes("UTF-8"), "ISO-8859-1");
7 }
8
9 response.setHeader("Content-Disposition", "attachment; filename="" + finalFileName + """);//设置为浏览器弹出下载提示框,而非直接在浏览器中打开