smartupload组件下载.gif和.swf格式文件时出错,救命啊
exception
org.apache.jasper.JasperException: getOutputStream() has already been called for this response
org.apache.jasper.servlet.JspServletWrapper.handle
JspException(JspServletWrapper.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.IllegalStateException: getOutputStream() has already been called for this response
org.apache.catalina.connector.Response.getWriter(Response.java:599)
org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)
org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:182)
org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
org.apache.jsp.GRBG.WJZG.download_jsp._jspService(download_jsp.java:176)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
其他的文件格式上传下载,没有任何问题。
------解决方案--------------------getOutputStream() 这个问题是你在操作的过程中有输入也有输出造成的,使用上传下载功能的页面最好是纯JSP代码,不要出现HTML,连空格和回车都不行,%> 与 <%之间也不要有换行和空格,当然 <%与%> 的中间倒是无所谓。
你说只下载gif和.swf时出现问题,那是不是你一下载成功就显示出来了,如果是这样你要把显示的功能放到另一页面,在下载成功后转到这个页面试试
------解决方案--------------------java.lang.IllegalStateException: getOutputStream() has already been called for this response 楼上说的,也是有可能的。
还有就是,你在servlet里,不要有跳转的语句,不要有out.print等语句。