controller正常跳转页面
ModelAndView mav = new ModelAndView("comment/exportcomment");
设置response
response.setHeader("Content-Disposition", "attachment; filename="+URLEncoder.encode("文件名","UTF-8")+".xls");
贴图:
页面css使用excel的样式,正常遍历数据,就可以将数据导出为excel了
页面贴图: