java Struts2 在拦截器里的跳转问题
程序员文章站
2024-02-17 20:48:16
复制代码 代码如下:java.lang.illegalstateexception at org.apache.catalina.connector.responsefac...
复制代码 代码如下:
java.lang.illegalstateexception
at org.apache.catalina.connector.responsefacade.senderror(responsefacade.java:405)
at org.apache.struts2.dispatcher.dispatcher.senderror(dispatcher.java:725)
at org.apache.struts2.dispatcher.dispatcher.serviceaction(dispatcher.java:488)
at org.apache.struts2.dispatcher.filterdispatcher.dofilter(filterdispatcher.java:467)
at org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:215)
at org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:188)
at org.springframework.web.filter.characterencodingfilter.dofilterinternal(characterencodingfilter.java:96)
at org.springframework.web.filter.onceperrequestfilter.dofilter(onceperrequestfilter.java:75)
at org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:215)
at org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:188)
at org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:213)
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:117)
at org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:108)
at org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:174)
at org.apache.coyote.http11.http11processor.process(http11processor.java:874)
at org.apache.coyote.http11.http11baseprotocol$http11connectionhandler.processconnection(http11baseprotocol.java:665)
at org.apache.tomcat.util.net.pooltcpendpoint.processsocket(pooltcpendpoint.java:528)
at org.apache.tomcat.util.net.leaderfollowerworkerthread.runit(leaderfollowerworkerthread.java:81)
at org.apache.tomcat.util.threads.threadpool$controlrunnable.run(threadpool.java:689)
at java.lang.thread.run(thread.java:595)
网上一查,是说页面两次调用了response.sendredirect()方法,在后面加了一个return null 后,问题成功解决。
因此想,应该在页面跳转时如果报同类型的异常,应该可以用同种方法解决。
下一篇: JSP 自定义标签第1/3页