org.apache.catalina.valves

Class ErrorReportValve

Implemented Interfaces:
Contained, MBeanRegistration, Valve

public class ErrorReportValve
extends ValveBase

Implementation of a Valve that outputs HTML error pages.

This Valve should be attached at the Host level, although it will work if attached to a Context.

HTML code from the Cocoon 2 project.

Version:
$Revision: 1.17.2.1 $ $Date: 2004/08/21 15:49:55 $

Authors:
Remy Maucherat
Craig R. McClanahan
Nicola Ken Barozzi Aisa
Stefano Mazzocchi
Yoav Shapira

Field Summary

protected static StringManager
sm
The StringManager for this package.

Fields inherited from class org.apache.catalina.valves.ValveBase

container, controller, debug, domain, info, mserver, oname, sm

Method Summary

String
getInfo()
Return descriptive information about this Valve implementation.
void
invoke(Request request, Response response, ValveContext context)
Invoke the next Valve in the sequence.
protected void
log(String message)
Log a message on the Logger associated with our Container (if any).
protected void
log(String message, Throwable throwable)
Log a message on the Logger associated with our Container (if any).
protected void
report(Request request, Response response, Throwable throwable)
Prints out an error report.
String
toString()
Return a String rendering of this object.

Methods inherited from class org.apache.catalina.valves.ValveBase

createObjectName, getContainer, getContainerName, getController, getDebug, getDomain, getInfo, getObjectName, getParentName, invoke, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setDebug, setObjectName

Field Details

sm

protected static StringManager sm
The StringManager for this package.

Method Details

getInfo

public String getInfo()
Return descriptive information about this Valve implementation.
Specified by:
getInfo in interface Valve
Overrides:
getInfo in interface ValveBase


invoke

public void invoke(Request request,
                   Response response,
                   ValveContext context)
            throws IOException,
                   ServletException
Invoke the next Valve in the sequence. When the invoke returns, check the response state, and output an error report is necessary.
Specified by:
invoke in interface Valve
Overrides:
invoke in interface ValveBase

Parameters:
request - The servlet request to be processed
response - The servlet response to be created
context - The valve context used to invoke the next valve in the current processing pipeline


log

protected void log(String message)
Log a message on the Logger associated with our Container (if any).

Parameters:
message - Message to be logged


log

protected void log(String message,
                   Throwable throwable)
Log a message on the Logger associated with our Container (if any).

Parameters:
message - Message to be logged
throwable - Associated exception


report

protected void report(Request request,
                      Response response,
                      Throwable throwable)
            throws IOException
Prints out an error report.

Parameters:
request - The request being processed
response - The response being generated
throwable - The exception that occurred (which possibly wraps a root cause exception


toString

public String toString()
Return a String rendering of this object.


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.