public void sendError(int code,String message) 
        throws IOException
    {        
        setStatus(code,message);
        
        // Generate normal error page.
        HttpRequest request=getHttpRequest();
        
        // If we are allowed to have a body 
        if (code!=__204_No_Content &&
            code!=__304_Not_Modified &&
            code!=__206_Partial_Content &&
            code>=200)
        {
            if (getHttpContext()!=null)
            {   
                Object o=
                    getHttpContext().getAttribute(HttpContext.__ErrorHandler);
                if (o!=null && o instanceof HttpHandler)
                    ((HttpHandler)o).handle(request.getPath(), null, request, this);
            }
        }
        else if (code!=__206_Partial_Content) 
        {
            _header.remove(HttpFields.__ContentType);
            _header.remove(HttpFields.__ContentLength);
            _characterEncoding=null;
            _mimeType=null;
        }
        
        commit();
    }
public void sendError ( int code , String message ) throws IOException { setStatus ( code , message ) ; HttpRequest request = getHttpRequest ( ) ; if ( code != __204_No_Content && code != __304_Not_Modified && code != __206_Partial_Content && code >= 200 ) { if ( getHttpContext ( ) != null ) { Object o = getHttpContext ( ) . getAttribute ( HttpContext . __ErrorHandler ) ; if ( o != null && o instanceof HttpHandler ) ( ( HttpHandler ) o ) . handle ( request . getPath ( ) , null , request , this ) ; } } else if ( code != __206_Partial_Content ) { _header . remove ( HttpFields . __ContentType ) ; _header . remove ( HttpFields . __ContentLength ) ; _characterEncoding = null ; _mimeType = null ; } commit ( ) ; }
Send Error Response.