title: How to solve Cannot call sendError() after the response has been committed
body: <p>How can I avoid my application to throw this exceptions?? My jsp's are becoming slow because of it.</p>
  
  <p>java.lang.IllegalStateException: Cannot call sendError() after the response has been committed
      at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:462)
      at org.netbeans.modules.web.monitor.server.MonitorResponseWrapper.sendError(MonitorResponseWrapper.java:152)
      at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:120)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:685)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)
      at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:296)
      at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161)
      at org.apache.jsp.relatorio_002dgarantias_jsp._jspx_meth_c_005fimport_005f2(relatorio_002dgarantias_jsp.java:485)
      at org.apache.jsp.relatorio_002dgarantias_jsp._jspService(relatorio_002dgarantias_jsp.java:176)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:748)</p>