sendError(sc,null);
if (_connection.isIncluding()) return;  if (isCommitted()) Log.warn("Committed before "+code+" "+message);  reset(); setStatus(code,message);  if (message==null) message=HttpGenerator.getReason(code);   if (code!=SC_NO_CONTENT && code!=SC_NOT_MODIFIED && code!=SC_PARTIAL_CONTENT && code>=SC_OK) { Request request = _connection.getRequest();  ErrorHandler error_handler = null; ContextHandler.Context context = request.getContext(); if (context!=null) error_handler=context.getContextHandler().getErrorHandler(); if (error_handler!=null) {  request.setAttribute(ServletHandler.__J_S_ERROR_STATUS_CODE,new Integer(code)); request.setAttribute(ServletHandler.__J_S_ERROR_MESSAGE, message); request.setAttribute(ServletHandler.__J_S_ERROR_REQUEST_URI, request.getRequestURI()); request.setAttribute(ServletHandler.__J_S_ERROR_SERVLET_NAME,request.getServletName());  error_handler.handle(null,_connection.getRequest(),this, Handler.ERROR); } else { setContentType(MimeTypes.TEXT_HTML); ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(2048); HttpConnection connection = HttpConnection.getCurrentConnection(); ErrorHandler.writeErrorPage(request, writer, connection.getResponse().getStatus(), connection.getResponse().getReason(),true); writer.flush(); setContentLength(writer.size()); writer.writeTo(getOutputStream()); writer.destroy(); } } else if (code!=SC_PARTIAL_CONTENT) { _connection.getRequestFields().remove(HttpHeaders.CONTENT_TYPE_BUFFER); _connection.getRequestFields().remove(HttpHeaders.CONTENT_LENGTH_BUFFER); _characterEncoding=null; _mimeType=null; _cachedMimeType=null; }  complete();
    public void sendError(int sc) throws IOException    {        sendError(sc,null);    }