JSP 文件下载时出现:Cannot forward after response has been committedjava.lang.IllegalStateException:Cannot forward after response has been committed\x05at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:339

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/23 15:13:58
JSP 文件下载时出现:Cannot forward after response has been committedjava.lang.IllegalStateException:Cannot forward after response has been committed\x05at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:339
xoE=Jě_KɸB!+zA&c{jvlP CIR7$!\$]Ovg8M{B{3Zs E\w]:t_7:0L(E?\WpQpb[D)c[Y"*[]5 2bdbZB&)a F,a0z鬼Oki,K[X+aMb1NPֲLLl0#]A&'3K|ߵ! q1#DaٶPtV-n@xHb;f罌m *ABX ! #j.zh6@eb !$fb┬:V@=!zJ=~t +GGɨoMNo HQ CLZCɤSS dBM q 6ꩲ3s $_WgNWDq((HCnLl3{po#^ (9Wx/.%YM#1+`c 3#nnyZ2((D%3VGјṞL-z 2\pvxU5<"gAĒ` 1sLZr8I WtltBaUkT6c&{xy1Ԁj(yVNV닌*Ћ댯W3$?9'~(:J8rEl\0U{k?9m '_%as&.|Oy<_wZ'8?l$v} F0qwoyX.KB &|~{P#*}d?>wqZԹw? iz4AׂJkʍBEǏMo1 UEV~ HQEJO;N;o!ult!/0 6[A)й`O2)

JSP 文件下载时出现:Cannot forward after response has been committedjava.lang.IllegalStateException:Cannot forward after response has been committed\x05at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:339
JSP 文件下载时出现:Cannot forward after response has been committed
java.lang.IllegalStateException:Cannot forward after response has been committed
\x05at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:339)
\x05at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
\x05at org.apache.jsp.get_005fycfxbg_jsp._jspService(get_005fycfxbg_jsp.java:939)
\x05at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
\x05at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
\x05at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
\x05at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
\x05at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
\x05at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
\x05at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
\x05at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
\x05at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
\x05at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
\x05at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
\x05at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
\x05at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
\x05at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
\x05at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
\x05at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394)
\x05at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:284)
\x05at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
\x05at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1714)
\x05at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
\x05at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
\x05at java.lang.Thread.run(Thread.java:619)

JSP 文件下载时出现:Cannot forward after response has been committedjava.lang.IllegalStateException:Cannot forward after response has been committed\x05at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:339
假设你用response.sendRedirect();跳转页面,执行这个语句之后,他的后面还有代码没有执行,你想想,既然跳转了页面,原页面的代码没有终止,一定会出错,这时就会出现你的错误Cannot forward after response has been committed.
解决方法,在response.sendRedirect();后面加 return;
如果不是这个问题的话,你贴下相关代码