All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class org.w3c.jigsaw.filters.ErrorFilter

java.lang.Object
   |
   +----org.w3c.tools.resources.AttributeHolder
           |
           +----org.w3c.tools.resources.Resource
                   |
                   +----org.w3c.tools.resources.FramedResource
                           |
                           +----org.w3c.tools.resources.ResourceFrame
                                   |
                                   +----org.w3c.tools.resources.ResourceFilter
                                           |
                                           +----org.w3c.jigsaw.filters.ErrorFilter

public class ErrorFilter
extends ResourceFilter
The ErroFilter class allows you to customize and enhance error messages. This filter will catch all errors on their way back to the client, and use internal requests to provide a nice customizable error message.

You can use any resources (including server side includes, content negotiated resources, etc) to deliver error messages.


Variable Index

 o ATTR_BASEURL
Attribute index - The base URL for error messages.
 o ATTR_EXTENSION
Attribute index - The common extension for error messages (can be null).
 o ERRED
A request state, to avoid looping on errors about errors.

Constructor Index

 o ErrorFilter()

Method Index

 o exceptionFilter(RequestInterface, ProtocolException, FilterInterface[], int)
We do catch exceptions, just in case we can customize the error.
 o getBaseURL()
Get the base URL describing the error directory.
 o getErrorResource(int)
Compute the path for the given status code.
 o getExtension()
Get the value of the extension attribute.
 o ingoingFilter(RequestInterface)
This one just makes sure the outgoing filter gets called.
 o initialize(Object[])
Initialize the frames of that framed resource.
 o outgoingFilter(RequestInterface, ReplyInterface)
Re-compute error message.

Variables

 o ERRED
 protected static final String ERRED
A request state, to avoid looping on errors about errors.

 o ATTR_BASEURL
 protected static int ATTR_BASEURL
Attribute index - The base URL for error messages.

 o ATTR_EXTENSION
 protected static int ATTR_EXTENSION
Attribute index - The common extension for error messages (can be null).

Constructors

 o ErrorFilter
 public ErrorFilter()

Methods

 o getBaseURL
 public String getBaseURL()
Get the base URL describing the error directory.

Returns:
The base URL.
 o getExtension
 public String getExtension()
Get the value of the extension attribute.

Returns:
A String, for the common extension to error messages, or null if undefined.
 o getErrorResource
 public String getErrorResource(int status)
Compute the path for the given status code.

Returns:
A path leading to the customizable error message for the given status code.
 o ingoingFilter
 public ReplyInterface ingoingFilter(RequestInterface request) throws ProtocolException
This one just makes sure the outgoing filter gets called.

Parameters:
request - The original request to be handled.
Throws: ProtocolException
If processing should be interrupted, because an abnormal situation occured.
Overrides:
ingoingFilter in class ResourceFilter
 o outgoingFilter
 public ReplyInterface outgoingFilter(RequestInterface req,
                                      ReplyInterface rep) throws ProtocolException
Re-compute error message. This filter uses internal redirection to get the error message body. In case of failure, the original reply is returned, otherwise, a new reply is gotten from the appropriate error resource, and is returned.

Parameters:
request - The request that has been handled.
reply - The reply, as emited by the original resource.
Returns:
A new error reply, having the same status code, and authentication information then the given reply, but enhanced with the error resource body.
Throws: ProtocolException
If processing should be interrupted, because an abnormal situation occured.
Overrides:
outgoingFilter in class ResourceFilter
 o exceptionFilter
 public ReplyInterface exceptionFilter(RequestInterface request,
                                       ProtocolException ex,
                                       FilterInterface filters[],
                                       int idx)
We do catch exceptions, just in case we can customize the error.

Parameters:
request - The request tha triggered the exception.
ex - The exception.
filters - Remaining filters to be called.
idx - Current filter index within above array.
Overrides:
exceptionFilter in class ResourceFilter
 o initialize
 public void initialize(Object values[])
Initialize the frames of that framed resource.

Overrides:
initialize in class FramedResource

All Packages  Class Hierarchy  This Package  Previous  Next  Index