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

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

 

2、代码如下

3、控制台提示信息图

 

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

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

 

posted @ 2016-12-16 16:40  流星雨—杰克  阅读(23425)  评论(0编辑  收藏  举报