java.lang.IllegalStateException: getOutputStream() 问题

buttontwo 2007-05-15 11:00:00
java.lang.IllegalStateException: getOutputStream() has already been called for this response


看了好多贴子,都说是<% %>外不能有空格,不能有out

也说在编译的jsp里找jspwriter与outstrem冲突,就没提出解决方法

我的download已经很简单了。
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312" import="com.jspsmart.upload.*"%>
<%
String fileName=(request.getSession(true).getAttribute("fileName")).toString();
SmartUpload su = new SmartUpload();
su.initialize(pageContext);
su.setContentDisposition(null);
su.downloadFile(fileName);
%>
找答案找了两天,基本上都是说空格,和有out啊,删除就行,或者谈到out与jspwriter冲突,可就是没有详细办法,有没有更好的下载组件,看到jspsmart都烦了,上传我用uploadbean。因为jspsmart不支持中文,郁闷,

大家写jsp,到底用什么上传下载的东西,jspsmart用的我吐血,真诚希望得到答案
...全文
426 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangyu198332 2007-05-15
  • 打赏
  • 举报
回复
SmartUpload su = new SmartUpload();
out.clear();
out = pageContext.pushBody();

添两行代码试试
估计是冲突问题
swoky 2007-05-15
  • 打赏
  • 举报
回复
前面的OutputStream没有关闭
javaboy2006 2007-05-15
  • 打赏
  • 举报
回复
fileupload 还比较好用。
buttontwo 2007-05-15
  • 打赏
  • 举报
回复
1

81,114

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧