设置response属性,如下
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
String fileName = (String) request.getAttribute("fileName");//获取文件名
response.setHeader("Content-Disposition","attachment;filename=" + new String(fileName.getBytes("GBK"), "iso8859-1"));