1. SPRING MVC 生成EXCEL
@RequestMapping(value = "/requestFileByJson", method = RequestMethod.POST)
public void getListByCallFunction(
@RequestBody String data,
HttpServletRequest request,
HttpServletResponse response, HttpSession session) throws Exception {
response.setContentType("application/ms-excel;charset=UTF-8");
response.setHeader("Content-Disposition","attachment;filename=".concat(String.valueOf(URLEncoder.encode(systemID + "_"+JName+".xls", "UTF-8"))));
OutputStream out = response.getOutputStream();
String sheetName = "导出WEBEDI";
String titleNames = null;
resultMapList = new ArrayList();
HSSFWorkbook excel = excelWordService.getExcelByDataMap(resultMapList,sheetName,titleNames);
excel.write(out);
out.flush();
}
<