title: Tomcat exception Cannot call sendError() after the response has been committed?
body: <p>While doing some operations in my application I got </p>
  
  <blockquote>
    <p>java.lang.IllegalStateException Cannot call sendError() </p>
  </blockquote>
  
  <p>When I reload the page again it work some time properly, but after some time again it shows the same exception. How can I overcome this exception? </p>
  
  <p>Below is the exception:</p>
  
  <pre><code>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.
  </code></pre>
  
  <p>Struts.xml</p>
  
  <pre><code>&lt;struts&gt;
      &lt;package name="default" extends="hibernate-default"&gt;
          &lt;action name="addUser" method="add" class="com.demo.action.UserAction"&gt;
              &lt;result name="input"&gt;/register.jsp&lt;/result&gt;
              &lt;result name="success" type="redirect"&gt;list&lt;/result&gt;
          &lt;/action&gt;
          &lt;action name="list" method="list" class="com.demo.action.UserAction"&gt;
              &lt;interceptor-ref name="basicStackHibernate" /&gt;
              &lt;result name="success"&gt;/list.jsp&lt;/result&gt;
          &lt;/action&gt;
      &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>