要在后台代码中加入如下语句:
response.setContentType("application/x-msexcel");
response.setHeader("Content-disposition", "attachment; filename="+ fileName);
OutputStream os = response.getOutputStream();
response.setContentType("application/x-msexcel");
response.setHeader("Content-disposition", "attachment; filename="+ fileName);
OutputStream os = response.getOutputStream();