@RequestMapping(value="${server.error.path:${error.path:/error}}")
public class Default404ErrorController
extends org.springframework.boot.autoconfigure.web.servlet.error.AbstractErrorController
参考:https://my.oschina.net/wangkang80/blog/1523308
| 构造器和说明 |
|---|
Default404ErrorController(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes,
org.springframework.boot.autoconfigure.web.ErrorProperties errorProperties)
Create a new
BasicErrorController instance. |
Default404ErrorController(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes,
org.springframework.boot.autoconfigure.web.ErrorProperties errorProperties,
List<org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver> errorViewResolvers)
Create a new
BasicErrorController instance. |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.http.ResponseEntity<DefaultRestfulErrorVO> |
error(javax.servlet.http.HttpServletRequest request) |
org.springframework.web.servlet.ModelAndView |
errorHtml(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
html错误,使用BasicErrorController的
|
String |
getErrorPath() |
protected org.springframework.boot.autoconfigure.web.ErrorProperties |
getErrorProperties()
Provide access to the error properties.
|
protected boolean |
isIncludeStackTrace(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType produces)
Determine if the stacktrace attribute should be included.
|
void |
setDefaultDocument(String defaultDocument) |
public Default404ErrorController(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes,
org.springframework.boot.autoconfigure.web.ErrorProperties errorProperties)
BasicErrorController instance.errorAttributes - the error attributeserrorProperties - configuration propertiespublic Default404ErrorController(org.springframework.boot.web.servlet.error.ErrorAttributes errorAttributes,
org.springframework.boot.autoconfigure.web.ErrorProperties errorProperties,
List<org.springframework.boot.autoconfigure.web.servlet.error.ErrorViewResolver> errorViewResolvers)
BasicErrorController instance.errorAttributes - the error attributeserrorProperties - configuration propertieserrorViewResolvers - error view resolverspublic void setDefaultDocument(String defaultDocument)
public String getErrorPath()
@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<DefaultRestfulErrorVO> error(javax.servlet.http.HttpServletRequest request)
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 org.springframework.boot.autoconfigure.web.ErrorProperties getErrorProperties()
Copyright © 2020. All rights reserved.