@Order(value=200) @ControllerAdvice public class DefaultGlobalExceptionAdvice extends AbstractControllerAdvice implements ControllerAdvicePredicate, ControllerAdviceProcessor, ControllerAdviceHttpProcessor
| 构造器和说明 |
|---|
DefaultGlobalExceptionAdvice() |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
exceptionHandler(Exception exception) |
Response |
process(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception exception)
异常处理
|
org.springframework.http.ResponseEntity<Response> |
process(Response response,
Throwable throwable)
生成ResponseEntity
|
boolean |
shouldApplyTo(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception exception)
判断是否要处理
|
getAfterControllerAdviceProcess, getBeforeControllerAdviceProcess, getControllerAdviceHttpProcessor, getControllerAdviceProcessor, getPredicates, getRejectStrategy, setAfterControllerAdviceProcess, setBeforeControllerAdviceProcess, setControllerAdviceHttpProcessor, setControllerAdviceProcessor, setPredicates, setRejectStrategypublic Response process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, @Nullable Object handler, Exception exception)
ControllerAdviceProcessorprocess 在接口中 ControllerAdviceProcessor@ExceptionHandler(value=java.lang.Throwable.class) public Object exceptionHandler(Exception exception)
public boolean shouldApplyTo(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
@Nullable
Object handler,
Exception exception)
ControllerAdvicePredicateshouldApplyTo 在接口中 ControllerAdvicePredicatepublic org.springframework.http.ResponseEntity<Response> process(Response response, Throwable throwable)
ControllerAdviceHttpProcessorprocess 在接口中 ControllerAdviceHttpProcessorresponse - GR定义的响应体throwable - 对应的异常Copyright © 2024. All rights reserved.