org.apache.catalina.valves
Class ErrorReportValve

java.lang.Object
  extended by org.apache.catalina.valves.ValveBase
      extended by org.apache.catalina.valves.ErrorReportValve
All Implemented Interfaces:
javax.management.MBeanRegistration, 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: 1237 $ $Date: 2009-11-03 02:55:48 +0100 (Tue, 03 Nov 2009) $
Author:
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, containerLog, controller, domain, mserver, next, oname
 
Constructor Summary
ErrorReportValve()
           
 
Method Summary
 java.lang.String getInfo()
          Return descriptive information about this Valve implementation.
protected  java.lang.String getPartialServletStackTrace(java.lang.Throwable t)
          Print out a partial servlet stack trace (truncating at the last occurrence of javax.servlet.).
 void invoke(Request request, Response response)
          Invoke the next Valve in the sequence.
protected  void report(Request request, Response response, java.lang.Throwable throwable)
          Prints out an error report.
 
Methods inherited from class org.apache.catalina.valves.ValveBase
backgroundProcess, createObjectName, event, getContainer, getContainerName, getController, getDomain, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName, toString
 
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)
            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
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet error occurs

report

protected void report(Request request,
                      Response response,
                      java.lang.Throwable throwable)
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

getPartialServletStackTrace

protected java.lang.String getPartialServletStackTrace(java.lang.Throwable t)
Print out a partial servlet stack trace (truncating at the last occurrence of javax.servlet.).



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