java导出数据成excel 报错:
HTTP Status 500 - Unable to show problem report: java.lang.IllegalStateException: getOutputStream() has already been called for this response
上面代码无效的话使用最新的POI试试 HSSFWorkbook hwb = ExportBasicModel.exportBasicExcel(res);
OutputStream out = response.getOutputStream();
hwb.write(out);
out.flush();
out.close();在使用完输出流以后调用以下两行代码即可:
Java代码 收藏代码
out.clear();
out = pageContext.pushBody();