Class ErrorPageErrorHandler
java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.handler.AbstractHandler
org.eclipse.jetty.server.handler.ErrorHandler
org.eclipse.jetty.servlet.ErrorPageErrorHandler
- All Implemented Interfaces:
Handler, ErrorHandler.ErrorPageMapper, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
An ErrorHandler that maps exceptions and status codes to URIs for dispatch using
the internal ERROR style of dispatch.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static enumNested classes/interfaces inherited from class ErrorHandler
ErrorHandler.ErrorPageMapperNested classes/interfaces inherited from class AbstractHandler
AbstractHandler.ErrorDispatchHandlerNested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListenerNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.Listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ErrorPageErrorHandler.ErrorCodeRange> protected javax.servlet.ServletContextstatic final Stringprivate static final LoggerFields inherited from class ErrorHandler
ERROR_CHARSET, ERROR_CONTEXT, ERROR_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrorPage(int from, int to, String uri) Adds ErrorPage mapping for a status code range.voidaddErrorPage(int code, String uri) Adds ErrorPage mapping for a status code.voidaddErrorPage(Class<? extends Throwable> exception, String uri) Adds ErrorPage mapping for an exception class.voidaddErrorPage(String exceptionClassName, String uri) Adds ErrorPage mapping for an exception class.protected voiddoStart()Starts the managed lifecycle beans in the order they were added.getErrorPage(javax.servlet.http.HttpServletRequest request) voidsetErrorPages(Map<String, String> errorPages) Methods inherited from class ErrorHandler
badMessageError, doError, errorPageForMethod, generateAcceptableResponse, generateAcceptableResponse, getAcceptableWriter, getCacheControl, getErrorHandler, getShowMessageInTitle, handle, handleErrorPage, isShowServlet, isShowStacks, setCacheControl, setShowMessageInTitle, setShowServlet, setShowStacks, write, writeErrorPage, writeErrorPageBody, writeErrorPageHead, writeErrorPageMessage, writeErrorPageStacksMethods inherited from class AbstractHandler
destroy, doStop, getServer, setServerMethods inherited from class ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeansMethods inherited from class AbstractLifeCycle
addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Dumpable.DumpableContainer
isDumpableMethods inherited from interface LifeCycle
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
-
Field Details
-
GLOBAL_ERROR_PAGE
- See Also:
-
LOG
-
_servletContext
protected javax.servlet.ServletContext _servletContext -
_errorPages
-
_errorPageList
-
-
Constructor Details
-
ErrorPageErrorHandler
public ErrorPageErrorHandler()
-
-
Method Details
-
getErrorPage
- Specified by:
getErrorPagein interfaceErrorHandler.ErrorPageMapper
-
getErrorPages
-
setErrorPages
-
addErrorPage
-
addErrorPage
-
addErrorPage
Adds ErrorPage mapping for a status code. This method is called as a result of an error-code element in a web.xml file or may be called directly.- Parameters:
code- The HTTP status code to matchuri- The URI of the error page.
-
addErrorPage
Adds ErrorPage mapping for a status code range. This method is not available from web.xml and must be called directly.- Parameters:
from- The lowest matching status codeto- The highest matching status codeuri- The URI of the error page.
-
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classAbstractHandler- Throws:
Exception
-