Class ErrorPageErrorHandler

  • All Implemented Interfaces:
    org.eclipse.jetty.server.Handler, org.eclipse.jetty.server.handler.ErrorHandler.ErrorPageMapper, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle

    public class ErrorPageErrorHandler
    extends org.eclipse.jetty.server.handler.ErrorHandler
    implements org.eclipse.jetty.server.handler.ErrorHandler.ErrorPageMapper
    An ErrorHandler that maps exceptions and status codes to URIs for dispatch using the internal ERROR style of dispatch.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.ErrorHandler

        org.eclipse.jetty.server.handler.ErrorHandler.ErrorPageMapper
      • Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler

        org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler
      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.servlet.ServletContext _servletContext  
      static java.lang.String GLOBAL_ERROR_PAGE  
      • Fields inherited from class org.eclipse.jetty.server.handler.ErrorHandler

        ERROR_PAGE
      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addErrorPage​(int from, int to, java.lang.String uri)
      Adds ErrorPage mapping for a status code range.
      void addErrorPage​(int code, java.lang.String uri)
      Adds ErrorPage mapping for a status code.
      void addErrorPage​(java.lang.Class<? extends java.lang.Throwable> exception, java.lang.String uri)
      Adds ErrorPage mapping for an exception class.
      void addErrorPage​(java.lang.String exceptionClassName, java.lang.String uri)
      Adds ErrorPage mapping for an exception class.
      protected void doStart()  
      java.lang.String getErrorPage​(javax.servlet.http.HttpServletRequest request)  
      java.util.Map<java.lang.String,​java.lang.String> getErrorPages()  
      void setErrorPages​(java.util.Map<java.lang.String,​java.lang.String> errorPages)  
      • Methods inherited from class org.eclipse.jetty.server.handler.ErrorHandler

        badMessageError, doError, generateAcceptableResponse, generateAcceptableResponse, getAcceptableWriter, getCacheControl, getErrorHandler, getShowMessageInTitle, handle, handleErrorPage, isShowStacks, setCacheControl, setShowMessageInTitle, setShowStacks, write, writeErrorPage, writeErrorPageBody, writeErrorPageHead, writeErrorPageMessage, writeErrorPageStacks
      • Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler

        destroy, doStop, getServer, setServer
      • Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

        addBean, 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, updateBeans
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

        dumpSelf
      • Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

        addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
    • Field Detail

      • GLOBAL_ERROR_PAGE

        public static final java.lang.String GLOBAL_ERROR_PAGE
        See Also:
        Constant Field Values
      • _servletContext

        protected javax.servlet.ServletContext _servletContext
    • Constructor Detail

      • ErrorPageErrorHandler

        public ErrorPageErrorHandler()
    • Method Detail

      • getErrorPage

        public java.lang.String getErrorPage​(javax.servlet.http.HttpServletRequest request)
        Specified by:
        getErrorPage in interface org.eclipse.jetty.server.handler.ErrorHandler.ErrorPageMapper
      • getErrorPages

        public java.util.Map<java.lang.String,​java.lang.String> getErrorPages()
      • setErrorPages

        public void setErrorPages​(java.util.Map<java.lang.String,​java.lang.String> errorPages)
        Parameters:
        errorPages - a map of Exception class names or error codes as a string to URI string
      • addErrorPage

        public void addErrorPage​(java.lang.Class<? extends java.lang.Throwable> exception,
                                 java.lang.String uri)
        Adds ErrorPage mapping for an exception class. This method is called as a result of an exception-type element in a web.xml file or may be called directly
        Parameters:
        exception - The exception
        uri - The URI of the error page.
      • addErrorPage

        public void addErrorPage​(java.lang.String exceptionClassName,
                                 java.lang.String uri)
        Adds ErrorPage mapping for an exception class. This method is called as a result of an exception-type element in a web.xml file or may be called directly
        Parameters:
        exceptionClassName - The exception
        uri - The URI of the error page.
      • addErrorPage

        public void addErrorPage​(int code,
                                 java.lang.String uri)
        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 match
        uri - The URI of the error page.
      • addErrorPage

        public void addErrorPage​(int from,
                                 int to,
                                 java.lang.String uri)
        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 code
        to - The highest matching status code
        uri - The URI of the error page.
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Overrides:
        doStart in class org.eclipse.jetty.server.handler.AbstractHandler
        Throws:
        java.lang.Exception