java导出数据成excel 报错 求分析,该如何处理
java导出数据成excel 报错 求分析
java导出数据成excel 报错:
HTTP Status 500 - Unable to show problem report: java.lang.IllegalStateException: getOutputStream() has already been called for this response
------解决方案--------------------
在使用完输出流以后调用以下两行代码即可:
Java代码 收藏代码
out.clear();
out = pageContext.pushBody();
------解决方案--------------------
用POI?如果你是从文件流取得数据然后直接推出数据生成excel,而且你的poi版本3.5以下好像会有个BUG。
上面代码无效的话使用最新的POI试试
------解决方案--------------------
HSSFWorkbook hwb = ExportBasicModel.exportBasicExcel(res);
OutputStream out = response.getOutputStream();
hwb.write(out);
out.flush();
out.close();
java导出数据成excel 报错:
HTTP Status 500 - Unable to show problem report: java.lang.IllegalStateException: getOutputStream() has already been called for this response
------解决方案--------------------
在使用完输出流以后调用以下两行代码即可:
Java代码 收藏代码
out.clear();
out = pageContext.pushBody();
------解决方案--------------------
用POI?如果你是从文件流取得数据然后直接推出数据生成excel,而且你的poi版本3.5以下好像会有个BUG。
上面代码无效的话使用最新的POI试试
------解决方案--------------------
HSSFWorkbook hwb = ExportBasicModel.exportBasicExcel(res);
OutputStream out = response.getOutputStream();
hwb.write(out);
out.flush();
out.close();