抛出异常getOutputStream() has already been called for this response
来源:互联网 发布:mac能用六维空间吗 编辑:程序博客网 时间:2024/06/05 15:22
最近在写代码的时候,遇到一个奇怪的问题。
项目简介:J2EE工程,strut2框架。
在jsp页面请求后台下载word表格时,总会抛出异常getOutputStream() has already been called for this response。参考了网上的方法,在文件流输出完毕之后,添加out.clear()和out=pageContext.pushBody();但是仍然不起作用。
最后在action返回时,使用return NONE; 完美解决。代码如下:
//关闭输出流 out.flush(); out.close(); //必须返回null,否则会抛出异常getOutputStream() has already been called for this responsereturn NONE;
附上网友的原贴:点击打开链接
注:几天后在用json与客户端交互的时候,莫名其妙地出现一个bug,传递的jsonList会额外增加一组action的参数。参考之前这个问题,在方法中返回null,即可。虽然我并不懂why。欢迎小伙伴在评论中给出解答~
阅读全文
1 0
- 抛出异常getOutputStream() has already been called for this response
- Excel导出时,后台抛出getOutputStream() has already been called for this response异常
- getOutputStream() has already been called for this response 异常处理
- 转异常getOutputStream() has already been called for this response
- getOutputStream() has already been called for this response异常
- 异常:getOutputStream() has already been called for this response
- 异常 getOutputStream() has already been called for this response
- JAVA异常 getOutputStream() has already been called for this response
- getOutputStream() has already been called for this response异常
- getOutputStream() has already been called for this response异常处理
- java_lang_IllegalStateException getOutputStream() has already been called for this response
- getOutputStream() has already been called for this response 的解决方法
- getOutputStream() has already been called for this response
- getOutputStream() has already been called for this response的解决方法
- getOutputStream() has already been called for this response
- getOutputStream() has already been called for this response
- getOutputStream() has already been called for this response
- getOutputStream() has already been called for this response 的解决方法
- MySQL定时执行脚本(计划任务)命令实例
- websphere更新web.xml
- sharedpreferences的使用方法小结
- spring中scope作用域
- Android调用系统相册的方法
- 抛出异常getOutputStream() has already been called for this response
- 让ListView指定的item获取焦点
- 1、hash法
- git github分支管理
- 第五章:初始化与清理
- 面向对象的表达式计算器
- Map集合按Key和Value分别排序
- 开源 AR 安卓APP:android AR app 开发及源码
- 京东618刘强东狂赚1199亿元 刘强东晒京东加班餐