@Controller
@RequestMapping(value="${server.error.path:${error.path:/error}}")
public class BasicErrorController
extends AbstractErrorController
@Controller, rendering ErrorAttributes.
More specific errors can be handled either using Spring MVC abstractions (e.g.
@ExceptionHandler) or by adding servlet
server error pages.ErrorAttributes,
ErrorProperties| Constructor and Description |
|---|
BasicErrorController(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes,
ErrorProperties errorProperties)
Create a new
BasicErrorController instance. |
BasicErrorController(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes,
ErrorProperties errorProperties,
java.util.List<ErrorViewResolver> errorViewResolvers)
Create a new
BasicErrorController instance. |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<java.util.Map<java.lang.String,java.lang.Object>> |
error(javax.servlet.http.HttpServletRequest request) |
org.springframework.web.servlet.ModelAndView |
errorHtml(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
protected org.springframework.boot.web.error.ErrorAttributeOptions |
getErrorAttributeOptions(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType mediaType) |
protected ErrorProperties |
getErrorProperties()
Provide access to the error properties.
|
protected boolean |
isIncludeBindingErrors(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType produces)
Determine if the errors attribute should be included.
|
protected boolean |
isIncludeMessage(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType produces)
Determine if the message attribute should be included.
|
protected boolean |
isIncludeStackTrace(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType produces)
Determine if the stacktrace attribute should be included.
|
org.springframework.http.ResponseEntity<java.lang.String> |
mediaTypeNotAcceptable(javax.servlet.http.HttpServletRequest request) |
getBooleanParameter, getErrorAttributes, getErrorsParameter, getMessageParameter, getStatus, getTraceParameter, resolveErrorViewpublic BasicErrorController(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes,
ErrorProperties errorProperties)
BasicErrorController instance.errorAttributes - the error attributeserrorProperties - configuration propertiespublic BasicErrorController(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes,
ErrorProperties errorProperties,
java.util.List<ErrorViewResolver> errorViewResolvers)
BasicErrorController instance.errorAttributes - the error attributeserrorProperties - configuration propertieserrorViewResolvers - error view resolvers@RequestMapping(produces="text/html")
public org.springframework.web.servlet.ModelAndView errorHtml(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
@RequestMapping public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String,java.lang.Object>> error(javax.servlet.http.HttpServletRequest request)
@ExceptionHandler(value=org.springframework.web.HttpMediaTypeNotAcceptableException.class) public org.springframework.http.ResponseEntity<java.lang.String> mediaTypeNotAcceptable(javax.servlet.http.HttpServletRequest request)
protected org.springframework.boot.web.error.ErrorAttributeOptions getErrorAttributeOptions(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType mediaType)
protected boolean isIncludeStackTrace(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType produces)
request - the source requestproduces - the media type produced (or MediaType.ALL)protected boolean isIncludeMessage(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType produces)
request - the source requestproduces - the media type produced (or MediaType.ALL)protected boolean isIncludeBindingErrors(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType produces)
request - the source requestproduces - the media type produced (or MediaType.ALL)protected ErrorProperties getErrorProperties()