Package org.apache.catalina.valves
Class ErrorReportValve
- java.lang.Object
-
- org.apache.catalina.valves.ValveBase
-
- org.apache.catalina.valves.ErrorReportValve
-
- All Implemented Interfaces:
Contained
,Lifecycle
,Valve
,GlassFishValve
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.19 $ $Date: 2007/05/05 05:32:41 $
- Author:
- Remy Maucherat, Craig R. McClanahan, Nicola Ken Barozzi Aisa, Stefano Mazzocchi
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringManager
sm
The StringManager for this package.-
Fields inherited from class org.apache.catalina.valves.ValveBase
container, controller, domain, lifecycle, log, next, oname, rb, started
-
Fields inherited from interface org.glassfish.web.valve.GlassFishValve
END_PIPELINE, INVOKE_NEXT
-
Fields inherited from interface org.apache.catalina.Lifecycle
AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, INIT_EVENT, START_EVENT, STOP_EVENT
-
-
Constructor Summary
Constructors Constructor Description ErrorReportValve()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getInfo()
Return descriptive information about this Valve implementation.int
invoke(Request request, Response response)
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 t)
Log a message on the Logger associated with our Container (if any).static String
makeErrorPage(int statusCode, String message, Throwable throwable, Throwable rootCause, String report, jakarta.servlet.http.HttpServletResponse response)
void
postInvoke(Request request, Response response)
A post-request processing implementation that does nothing.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
addLifecycleListener, backgroundProcess, createObjectName, event, findLifecycleListeners, getContainer, getController, getDebug, getDomain, getNext, getObjectName, getParentName, invoke, isStarted, removeLifecycleListener, setContainer, setController, setDebug, setNext, setObjectName, start, stop
-
-
-
-
Field Detail
-
sm
protected static final StringManager sm
The StringManager for this package.
-
-
Method Detail
-
getInfo
public String getInfo()
Return descriptive information about this Valve implementation.
-
invoke
public int invoke(Request request, Response response) throws IOException, jakarta.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 interfaceGlassFishValve
- Specified by:
invoke
in classValveBase
- Parameters:
request
- The servlet request to be processedresponse
- The servlet response to be created- Returns:
INVOKE_NEXT
orEND_PIPELINE
- Throws:
IOException
- if an input/output error occursjakarta.servlet.ServletException
- if a servlet error occurs
-
postInvoke
public void postInvoke(Request request, Response response) throws IOException, jakarta.servlet.ServletException
Description copied from class:ValveBase
A post-request processing implementation that does nothing. Very few Valves override this behaviour as most Valve logic is used for request processing.- Specified by:
postInvoke
in interfaceGlassFishValve
- Overrides:
postInvoke
in classValveBase
- Parameters:
request
- The servlet request to be processedresponse
- The servlet response to be created- Throws:
IOException
- if an input/output error occursjakarta.servlet.ServletException
- if a servlet error occurs
-
toString
public String toString()
Return a String rendering of this object.
-
report
protected void report(Request request, Response response, Throwable throwable) throws IOException
Prints out an error report.- Parameters:
request
- The request being processedresponse
- The response being generatedthrowable
- The exception that occurred (which possibly wraps a root cause exception- Throws:
IOException
-
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 t)
Log a message on the Logger associated with our Container (if any).- Parameters:
message
- Message to be loggedt
- Associated exception
-
-