org.springframework.boot.web.server

Class ErrorPage

  • java.lang.Object
    • org.springframework.boot.web.server.ErrorPage


  • public class ErrorPage
    extends java.lang.Object
    Simple server-independent abstraction for error pages. Roughly equivalent to the <error-page> element traditionally found in web.xml.
    Since:
    2.0.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      ErrorPage(java.lang.Class<? extends java.lang.Throwable> exception, java.lang.String path) 
      ErrorPage(org.springframework.http.HttpStatus status, java.lang.String path) 
      ErrorPage(java.lang.String path) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj) 
      java.lang.Class<? extends java.lang.Throwable> getException()
      Returns the exception type (or null for a page that matches by status).
      java.lang.String getExceptionName()
      The exception type name.
      java.lang.String getPath()
      The path to render (usually implemented as a forward), starting with "/".
      org.springframework.http.HttpStatus getStatus()
      The HTTP status value that this error page matches (or null for a page that matches by exception).
      int getStatusCode()
      The HTTP status value that this error page matches.
      int hashCode() 
      boolean isGlobal()
      Return if this error page is a global one (matches all unmatched status and exception types).
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ErrorPage

        public ErrorPage(java.lang.String path)
      • ErrorPage

        public ErrorPage(org.springframework.http.HttpStatus status,
                         java.lang.String path)
      • ErrorPage

        public ErrorPage(java.lang.Class<? extends java.lang.Throwable> exception,
                         java.lang.String path)
    • Method Detail

      • getPath

        public java.lang.String getPath()
        The path to render (usually implemented as a forward), starting with "/". A custom controller or servlet path can be used, or if the server supports it, a template path (e.g. "/error.jsp").
        Returns:
        the path that will be rendered for this error
      • getException

        public java.lang.Class<? extends java.lang.Throwable> getException()
        Returns the exception type (or null for a page that matches by status).
        Returns:
        the exception type or null
      • getStatus

        public org.springframework.http.HttpStatus getStatus()
        The HTTP status value that this error page matches (or null for a page that matches by exception).
        Returns:
        the status or null
      • getStatusCode

        public int getStatusCode()
        The HTTP status value that this error page matches.
        Returns:
        the status value (or 0 for a page that matches any status)
      • getExceptionName

        public java.lang.String getExceptionName()
        The exception type name.
        Returns:
        the exception type name (or null if there is none)
      • isGlobal

        public boolean isGlobal()
        Return if this error page is a global one (matches all unmatched status and exception types).
        Returns:
        if this is a global error page
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object