struts2下载文件时中文名乱码问题

是编码的问题,转换成iso-8859-1方可解决问题。此时struts.xml文件无需再配置Content-Disposition

response.setHeader("Content-Disposition", "attachment;filename="+new String(fileName.getBytes(),"iso-8859-1")+".xls");

猜你喜欢

转载自blog.csdn.net/a597637246/article/details/79976013