org.springframework.boot.context.embedded
Class ErrorPage

java.lang.Object
  extended by org.springframework.boot.context.embedded.ErrorPage

public class ErrorPage
extends Object

Simple container-independent abstraction for servlet error pages. Roughly equivalent to the <error-page> element traditionally found in web.xml.

Author:
Dave Syer

Constructor Summary
ErrorPage(Class<? extends Throwable> exception, String path)
           
ErrorPage(org.springframework.http.HttpStatus status, String path)
           
ErrorPage(String path)
           
 
Method Summary
 boolean equals(Object obj)
           
 Class<? extends Throwable> getException()
           
 String getExceptionName()
          The exception type name.
 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.
 int getStatusCode()
          The HTTP status value that this error page matches.
 int hashCode()
           
 boolean isGlobal()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorPage

public ErrorPage(String path)

ErrorPage

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

ErrorPage

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

getPath

public 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 container supports it, a template path (e.g. "/error.jsp").

Returns:
the path that will be rendered for this error

getException

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

getStatus

public org.springframework.http.HttpStatus getStatus()
The HTTP status value that this error page matches.

Returns:
the status

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 String getExceptionName()
The exception type name.

Returns:
the exception type name (or null if there is none)

isGlobal

public boolean isGlobal()
Returns:
is this error page a global one (matches all unmatched status and exception types)?

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013. All Rights Reserved.