Class ErrorPageErrorHandler

java.lang.Object
org.eclipse.jetty.ee10.servlet.ErrorHandler
org.eclipse.jetty.ee10.servlet.ErrorPageErrorHandler
All Implemented Interfaces:
ErrorHandler.ErrorPageMapper, Request.Handler, Invocable

public class ErrorPageErrorHandler extends ErrorHandler implements ErrorHandler.ErrorPageMapper
An ErrorHandler that maps exceptions and status codes to URIs for dispatch using the internal ERROR style of dispatch.
  • Field Details

  • Constructor Details

    • ErrorPageErrorHandler

      public ErrorPageErrorHandler()
  • Method Details

    • isUnwrapServletException

      public boolean isUnwrapServletException()
      Returns:
      True if ServletException is unwrapped for RequestDispatcher.ERROR_EXCEPTION
    • setUnwrapServletException

      public void setUnwrapServletException(boolean unwrapServletException)
      Parameters:
      unwrapServletException - True if ServletException should be unwrapped for RequestDispatcher.ERROR_EXCEPTION
    • getErrorPage

      public String getErrorPage(jakarta.servlet.http.HttpServletRequest request)
      Specified by:
      getErrorPage in interface ErrorHandler.ErrorPageMapper
    • getErrorPages

      public Map<String,String> getErrorPages()
    • setErrorPages

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

      public void addErrorPage(Class<? extends Throwable> exception, 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(String exceptionClassName, 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, 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, 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.