String fileName = FileNameUtils.generatorFileName(map);
//转换为url时如果有空格会变为+,再转为%20,浏览器就会识别了
fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
//导出设置
response.setContentType("application/vnd.msexcel");
response.addHeader("Content-Disposition", "inline; filename=" + fileName
+ '.xlsx');
导出excel2007-respose
最新推荐文章于 2023-04-11 15:47:54 发布