@Controller
@ConditionalOnWebApplication
@RequestMapping(value="${server.error.path:${error.path:/error}}")
public class CustomErrorController
extends org.springframework.boot.autoconfigure.web.AbstractErrorController
| 构造器和说明 |
|---|
CustomErrorController(org.springframework.boot.autoconfigure.web.ErrorAttributes errorAttributes) |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.http.ResponseEntity<java.lang.Object> |
error(javax.servlet.http.HttpServletRequest request)
其他请求
|
org.springframework.http.ResponseEntity<java.lang.Object> |
errorPlain(javax.servlet.http.HttpServletRequest request)
"text/plain", "text/html"的请求
|
java.lang.String |
getErrorPath() |
protected org.springframework.boot.autoconfigure.web.ErrorProperties |
getErrorProperties() |
protected boolean |
isIncludeStackTrace(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType... produces) |
@Autowired public CustomErrorController(org.springframework.boot.autoconfigure.web.ErrorAttributes errorAttributes)
public java.lang.String getErrorPath()
protected org.springframework.boot.autoconfigure.web.ErrorProperties getErrorProperties()
protected boolean isIncludeStackTrace(javax.servlet.http.HttpServletRequest request,
org.springframework.http.MediaType... produces)
request - requestproduces - 请求类型@RequestMapping(produces={"text/plain","text/html"})
@ResponseBody
public org.springframework.http.ResponseEntity<java.lang.Object> errorPlain(javax.servlet.http.HttpServletRequest request)
throws com.fasterxml.jackson.core.JsonProcessingException
request - requestcom.fasterxml.jackson.core.JsonProcessingException - JsonProcessingException@RequestMapping
@ResponseBody
public org.springframework.http.ResponseEntity<java.lang.Object> error(javax.servlet.http.HttpServletRequest request)
throws com.fasterxml.jackson.core.JsonProcessingException
request - requestcom.fasterxml.jackson.core.JsonProcessingException - JsonProcessingException