Class AbstractErrorController
java.lang.Object
org.springframework.boot.autoconfigure.web.servlet.error.AbstractErrorController
- All Implemented Interfaces:
ErrorController
- Direct Known Subclasses:
BasicErrorController
Abstract base class for error
@Controller
implementations.- Since:
- 1.3.0
- Author:
- Dave Syer, Phillip Webb, Scott Frederick, Moritz Halbritter
- See Also:
-
Constructor Summary
ConstructorDescriptionAbstractErrorController
(ErrorAttributes errorAttributes) AbstractErrorController
(ErrorAttributes errorAttributes, List<ErrorViewResolver> errorViewResolvers) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
getBooleanParameter
(HttpServletRequest request, String parameterName) getErrorAttributes
(HttpServletRequest request, ErrorAttributeOptions options) protected boolean
getErrorsParameter
(HttpServletRequest request) Returns whether the errors parameter is set.protected boolean
getMessageParameter
(HttpServletRequest request) Returns whether the message parameter is set.protected boolean
getPathParameter
(HttpServletRequest request) Returns whether the path parameter is set.protected HttpStatus
getStatus
(HttpServletRequest request) protected boolean
getTraceParameter
(HttpServletRequest request) Returns whether the trace parameter is set.protected ModelAndView
resolveErrorView
(HttpServletRequest request, HttpServletResponse response, HttpStatus status, Map<String, Object> model) Resolve any specific error views.
-
Constructor Details
-
AbstractErrorController
-
AbstractErrorController
public AbstractErrorController(ErrorAttributes errorAttributes, List<ErrorViewResolver> errorViewResolvers)
-
-
Method Details
-
getErrorAttributes
protected Map<String,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
- Since:
- 3.3.0
-
getBooleanParameter
-
getStatus
-
resolveErrorView
protected 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
ModelAndView
ornull
if the default should be used - Since:
- 1.4.0
-