Class AbstractErrorController
java.lang.Object
org.springframework.boot.webmvc.autoconfigure.error.AbstractErrorController
- All Implemented Interfaces:
ErrorController
- Direct Known Subclasses:
BasicErrorController
Abstract base class for error
@Controller implementations.- Since:
- 4.0.0
- Author:
- Dave Syer, Phillip Webb, Scott Frederick, Moritz Halbritter
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractErrorController(ErrorAttributes errorAttributes) AbstractErrorController(ErrorAttributes errorAttributes, @Nullable List<ErrorViewResolver> errorViewResolvers) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleangetBooleanParameter(HttpServletRequest request, String parameterName) getErrorAttributes(HttpServletRequest request, ErrorAttributeOptions options) protected booleangetErrorsParameter(HttpServletRequest request) Returns whether the errors parameter is set.protected booleangetMessageParameter(HttpServletRequest request) Returns whether the message parameter is set.protected booleangetPathParameter(HttpServletRequest request) Returns whether the path parameter is set.protected HttpStatusgetStatus(HttpServletRequest request) protected booleangetTraceParameter(HttpServletRequest request) Returns whether the trace parameter is set.protected @Nullable ModelAndViewresolveErrorView(HttpServletRequest request, HttpServletResponse response, HttpStatus status, Map<String, Object> model) Resolve any specific error views.
-
Constructor Details
-
AbstractErrorController
-
AbstractErrorController
public AbstractErrorController(ErrorAttributes errorAttributes, @Nullable List<ErrorViewResolver> errorViewResolvers)
-
-
Method Details
-
getErrorAttributes
protected Map<String, @Nullable Object> getErrorAttributes(HttpServletRequest request, ErrorAttributeOptions options) -
getTraceParameter
Returns whether the trace parameter is set.- Parameters:
request- the request- Returns:
- whether the trace parameter is set
-
getMessageParameter
Returns whether the message parameter is set.- Parameters:
request- the request- Returns:
- whether the message parameter is set
-
getErrorsParameter
Returns whether the errors parameter is set.- Parameters:
request- the request- Returns:
- whether the errors parameter is set
-
getPathParameter
Returns whether the path parameter is set.- Parameters:
request- the request- Returns:
- whether the path parameter is set
-
getBooleanParameter
-
getStatus
-
resolveErrorView
protected @Nullable ModelAndView resolveErrorView(HttpServletRequest request, HttpServletResponse response, HttpStatus status, Map<String, Object> model) Resolve any specific error views. By default this method delegates toErrorViewResolvers.- Parameters:
request- the requestresponse- the responsestatus- the HTTP statusmodel- the suggested model- Returns:
- a specific
ModelAndViewornullif the default should be used
-