ContextHandler.Context context = request.getContext();
ContextHandler.SContext context = request.getContext();
    public void sendError(int code, String message) throws IOException    {    	if (_connection.isIncluding())    		return;    	        if (isCommitted())            Log.warn("Committed before "+code+" "+message);        reset();        setStatus(code,message);                if (message==null)            message=HttpGenerator.getReason(code);        // If we are allowed to have a body        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)            {                // TODO - probably should reset these after the request?                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_8859_1);                ByteArrayISO8859Writer writer= new ByteArrayISO8859Writer(2048);                if (message != null)                {                    message= StringUtil.replace(message, "&", "&amp;");                    message= StringUtil.replace(message, "<", "&lt;");                    message= StringUtil.replace(message, ">", "&gt;");                }                String uri= request.getRequestURI();                if (uri!=null)                {                    uri= StringUtil.replace(uri, "&", "&amp;");                    uri= StringUtil.replace(uri, "<", "&lt;");                    uri= StringUtil.replace(uri, ">", "&gt;");                }                                writer.write("<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\"/>\n");                writer.write("<title>Error ");                writer.write(Integer.toString(code));                writer.write(' ');                if (message==null)                    message=HttpGenerator.getReason(code);                writer.write(message);                writer.write("</title>\n</head>\n<body>\n<h2>HTTP ERROR: ");                writer.write(Integer.toString(code));                writer.write("</h2><pre>");                writer.write(message);                writer.write("</pre>\n<p>RequestURI=");                writer.write(uri);                writer.write("</p>\n<p><i><small><a href=\"http://jetty.mortbay.org\">Powered by jetty://</a></small></i></p>");                                for (int i= 0; i < 20; i++)                    writer.write("\n                                                ");                writer.write("\n</body>\n</html>\n");                                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();    }