jsp里用out.print("aaaa")有异常怎么处理?
我在jsp 里用<%
...
out.print("<script language='javascript'>alert(验证码错误!);window.location='login.html';return false;");
....
%>
一直抛出异常 说与什么OutputStream 冲突,请问这个要怎么处理 啊?
谢谢!
具体异常提示如下:
2008-2-11 9:44:06 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet debugjsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:596)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:186)
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:191)
at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
at org.apache.jsp.image_jsp._jspService(org.apache.jsp.image_jsp:122)
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:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.(PoolTcpEndpoint.java:527)
at org.apache.tomcat.(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
[[it] 本帖最后由 yanhaolang 于 2008-2-11 09:44 编辑 [/it]]