java.lang.IllegalStateException异常getOutputStream() has already been called for this responseat org.apache.catalina.connector.Response.getWriter(Response.java:603)at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:196)at

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/26 11:34:21
java.lang.IllegalStateException异常getOutputStream() has already been called for this responseat org.apache.catalina.connector.Response.getWriter(Response.java:603)at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:196)at
x[OGǿHh:KRic5M;ٱo4`( H%RH[ cev'Bgw`${ydYs;sv]N6JC{AF D^yK4bɱ Fj t7LBN€b42%qd Lhd0 @``A@ LR!2kh@SŊQā;zkGBh#D{P`B haV[.,XZUm윛%zo qFahEK)tv7ZB)Lܵ(ˁvJڥȸsؽjKK¿ D󖁴 k2FDƠF[ QȈ1u[J~:[_5I!{BUO Fl (Y0 b[$&Hl }V#q^Ii)J_b,;&foC;Dy|iJ=jt|ܔ&W9Q쪹xv~|J1M!i3]BڨtI[R!x А k8Vt^"ӡq 亂Nv.ωz}ȰkvX/FDQxrN*_ g ,8t#I8&1'`!Q˄_ъRpѫT"_J{Ꮏ=՞ \'G_98'sp>b՞^n+NpW/Փ)euG^|X\>MmYP,v#$|ݞ7 ]rQI0_XP>*W].l_x(Cy yx,MFrg=?x#e(.`_{Y=Y Ƃ؝.`I 

java.lang.IllegalStateException异常getOutputStream() has already been called for this responseat org.apache.catalina.connector.Response.getWriter(Response.java:603)at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:196)at
java.lang.IllegalStateException异常
getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:603)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:196)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)
at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:190)
at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:118)
at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:78)
at org.apache.jsp.image_jsp._jspService(image_jsp.java:117)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:319)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:270)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:191)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:227)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:211)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:817)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:623)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:444)
at java.lang.Thread.run(Thread.java:619)
貌似是哪个流没有关闭...

java.lang.IllegalStateException异常getOutputStream() has already been called for this responseat org.apache.catalina.connector.Response.getWriter(Response.java:603)at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:196)at
我过去遇到这个问题是因为多次调用一个已经关闭的对象.
比如:同一个页面中再次调用response.sendRedirect()方法.还有可能是提交的URL错误,即不是个有效的URL.
我建议你看看是不是把response.sendRedirect()放到循环里了,或者是多次调用了.API上说调用sendRedirect()方法后,response就已经是close的了.
大哥,结贴啊.