## org.apache.catalina.valves
Class ErrorReportValve

    java.lang.Object
      org.apache.catalina.valves.ValveBase
          org.apache.catalina.valves.ErrorReportValve

All Implemented Interfaces:
  Contained, 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: 466595 $ $Date: 2006-10-21 23:24:41 +0100 (Sat, 21 Oct 2006) $
Author:
  Remy Maucherat, Craig R. McClanahan, Nicola Ken Barozzi Aisa, Stefano Mazzocchi

Field Summary
`protected static StringManager` `sm` The StringManager for this package.

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

Constructor Summary
`ErrorReportValve()`

Method Summary
`java.lang.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(java.lang.String message)` Log a message on the Logger associated with our Container (if any).
`protected void` `log(java.lang.String message, java.lang.Throwable throwable)` Log a message on the Logger associated with our Container (if any).
`protected void` `report(Request request, Response response, java.lang.Throwable throwable)` Prints out an error report.
`java.lang.String` `toString()` Return a String rendering of this object.

Methods inherited from class org.apache.catalina.valves.ValveBase
`getContainer, getDebug, setContainer, setDebug`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### sm

    protected static StringManager sm

  The StringManager for this package.

Constructor Detail

### ErrorReportValve

    public ErrorReportValve()

Method Detail

### getInfo

    public java.lang.String getInfo()

  Return descriptive information about this Valve implementation.

  Specified by:
    `getInfo` in interface `Valve`
  Overrides:
    `getInfo` in class `ValveBase`

### invoke

    public void invoke(Request request,
                       Response response,
                       ValveContext context)
                throws java.io.IOException,
                       javax.servlet.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`
  Specified by:
    `invoke` in class `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
  Throws:
    `java.io.IOException` - if an input/output error occurs
    `javax.servlet.ServletException` - if a servlet error occurs

### toString

    public java.lang.String toString()

  Return a String rendering of this object.

### report

    protected void report(Request request,
                          Response response,
                          java.lang.Throwable throwable)
                   throws java.io.IOException

  Prints out an error report.

  Parameters:
    `request` - The request being processed
    `response` - The response being generated
  Throws:
    `exception` - The exception that occurred (which possibly wraps a root cause exception
    `java.io.IOException`

### log

    protected void log(java.lang.String message)

  Log a message on the Logger associated with our Container (if any).

  Parameters:
    `message` - Message to be logged

### log

    protected void log(java.lang.String message,
                       java.lang.Throwable throwable)

  Log a message on the Logger associated with our Container (if any).

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

Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.