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.
Lifecycle.SingleUse
asyncSupported, container, containerLog, next, sm
mserver
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
Constructor and Description |
---|
ErrorReportValve() |
Modifier and Type | Method and Description |
---|---|
String |
getInfo()
Return descriptive information about this Valve implementation.
|
protected String |
getPartialServletStackTrace(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.
|
boolean |
isShowReport() |
boolean |
isShowServerInfo() |
protected void |
report(Request request,
Response response,
Throwable throwable)
Prints out an error report.
|
void |
setShowReport(boolean showReport)
Enables/Disables full error reports
|
void |
setShowServerInfo(boolean showServerInfo)
Enables/Disables server info on error pages
|
backgroundProcess, event, getContainer, getDomainInternal, getNext, getObjectNameKeyProperties, initInternal, isAsyncSupported, setAsyncSupported, setContainer, setNext, startInternal, stopInternal, toString
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
public String getInfo()
public void invoke(Request request, Response response) throws IOException, ServletException
invoke
in interface Valve
invoke
in class ValveBase
request
- The servlet request to be processedresponse
- The servlet response to be createdIOException
- if an input/output error occursServletException
- if a servlet error occursprotected void report(Request request, Response response, Throwable throwable)
request
- The request being processedresponse
- The response being generatedthrowable
- The exception that occurred (which possibly wraps
a root cause exceptionprotected String getPartialServletStackTrace(Throwable t)
public void setShowReport(boolean showReport)
showReport
- public boolean isShowReport()
public void setShowServerInfo(boolean showServerInfo)
showServerInfo
- public boolean isShowServerInfo()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.