日期:2014-05-18  浏览次数:20684 次

java.lang.IllegalStateException: getOutputStream() 问题
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用的我吐血,真诚希望得到答案

------解决方案--------------------
fileupload 还比较好用。
------解决方案--------------------
前面的OutputStream没有关闭
------解决方案--------------------
SmartUpload su = new SmartUpload();
out.clear();
out = pageContext.pushBody();

添两行代码试试
估计是冲突问题