用java实现文件下载,提示java.lang.IllegalStateException: getOutputStream() has already been called for this re

来源:互联网 发布:减肥后期越来越难 知乎 编辑:程序博客网 时间:2024/06/06 04:23

1、 用java实现文件下载,提示java.lang.IllegalStateException: getOutputStream() has already been called for this response 

 

2、代码如下

3、控制台提示信息图

 

4、解决方案是:在给处理下载文件转发的jsp页面,添加

<%
out.clear();
out = pageContext.pushBody();
%>

 

阅读全文
0 0