Tomcat 异常 在响应提交后无法调用 sendError()?
2022-09-01 04:51:00
在我的应用程序中执行一些操作时,我得到了
java.lang.IllegalStateException 無法 call sendError()
当我再次重新加载页面时,它会正常工作一段时间,但一段时间后,它再次显示相同的异常。如何克服此异常?
以下是例外情况:
HTTP Status 500 - Cannot call sendError() after the response has been committed
type Exception report
message Cannot call sendError() after the response has been committed
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:451)
org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:725)
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.40 logs.
支柱.xml
<struts>
<package name="default" extends="hibernate-default">
<action name="addUser" method="add" class="com.demo.action.UserAction">
<result name="input">/register.jsp</result>
<result name="success" type="redirect">list</result>
</action>
<action name="list" method="list" class="com.demo.action.UserAction">
<interceptor-ref name="basicStackHibernate" />
<result name="success">/list.jsp</result>
</action>
</package>
</struts>