@Order(value=-2147483648) public class DefaultErrorAttributes extends java.lang.Object implements ErrorAttributes, org.springframework.web.servlet.HandlerExceptionResolver, org.springframework.core.Ordered
ErrorAttributes. Provides the following attributes
when possible:
ObjectErrors from a BindingResult exception (if
configured)ErrorAttributesERROR_ATTRIBUTE| Constructor and Description |
|---|
DefaultErrorAttributes() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Throwable |
getError(org.springframework.web.context.request.WebRequest webRequest)
Return the underlying cause of the error or
null if the error cannot be
extracted. |
java.util.Map<java.lang.String,java.lang.Object> |
getErrorAttributes(org.springframework.web.context.request.WebRequest webRequest,
ErrorAttributeOptions options)
Returns a
Map of the error attributes. |
protected java.lang.String |
getMessage(org.springframework.web.context.request.WebRequest webRequest,
java.lang.Throwable error)
Returns the message to be included as the value of the
message error
attribute. |
int |
getOrder() |
org.springframework.web.servlet.ModelAndView |
resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler,
java.lang.Exception ex) |
public int getOrder()
getOrder in interface org.springframework.core.Orderedpublic org.springframework.web.servlet.ModelAndView resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler,
java.lang.Exception ex)
resolveException in interface org.springframework.web.servlet.HandlerExceptionResolverpublic java.util.Map<java.lang.String,java.lang.Object> getErrorAttributes(org.springframework.web.context.request.WebRequest webRequest,
ErrorAttributeOptions options)
ErrorAttributesMap of the error attributes. The map can be used as the model of
an error page ModelAndView, or returned as a
@ResponseBody.getErrorAttributes in interface ErrorAttributeswebRequest - the source requestoptions - options for error attribute contentsprotected java.lang.String getMessage(org.springframework.web.context.request.WebRequest webRequest,
java.lang.Throwable error)
message error
attribute. By default the returned message is the first of the following that is
not empty:
RequestDispatcher.ERROR_MESSAGE request attribute.
error.
No message available.
webRequest - current requesterror - current error, if anypublic java.lang.Throwable getError(org.springframework.web.context.request.WebRequest webRequest)
ErrorAttributesnull if the error cannot be
extracted.getError in interface ErrorAttributeswebRequest - the source requestException that caused the error or null