在使用poi导出Excel文件的时候出现了:java.lang.IllegalStateException: getOutputStream() has already been called for this response的异常,检查了几遍自己写的代码,逻辑方面没什么异常,但在检查调用poi的API的时候发现XSSFWorkbook对象根本不能满足十多万甚至几十万数据导出的需求,如果要导出几十万的数据到Excel文件就要使用SXSSFWorkbook对象,将原来的XSSFWorkbook类改为SXSSFWorkbook就可以了。

异常截图:
java.lang.IllegalStateException: getOutputStream() has already been called for this response

使用SXSSFWorkbook类:
java.lang.IllegalStateException: getOutputStream() has already been called for this response

相关文章:

  • 2021-11-25
  • 2021-06-25
  • 2021-12-11
  • 2021-08-28
猜你喜欢
  • 2021-10-16
  • 2021-10-22
相关资源
相似解决方案