编写步骤:
1.写一个excel模板
topicMap为后台Map中的key值,value值为一个list,在这里进行遍历;
2.在webapp下建一个文件夹,将该模板放入;
3.上代码
我是用的springMvc
@RequestMapping(value = "xxxxxxx")
public void exportByYjfx(HttpServletResponse response, HttpServletRequest request)
throws FileNotFoundException {
// 文件根路径
String fileRootPath = request.getSession().getServletContext().getRealPath("/excelTempl