接口 HandlerMethodInterceptor
-
- 所有已知实现类:
WebEventPublisher
public interface HandlerMethodInterceptorHandlerMethodInterceptor that allows for customizedHandlerMethodexecution chains. Applications can register any number of existing or custom interceptors for certain groups of handlers, to add common preprocessing behavior without needing to modify each handler implementation.A HandlerInterceptor gets called before the appropriate HandlerAdapter triggers the execution of the handler itself.
- 从以下版本开始:
- 1.0.0
- 作者:
- Mercy
- 另请参阅:
HandlerMethod,org.springframework.web.servlet.DispatcherServlet,org.springframework.web.reactive.DispatcherHandler,org.springframework.web.servlet.HandlerMapping,org.springframework.web.reactive.HandlerMapping,org.springframework.web.servlet.HandlerAdapter,org.springframework.web.reactive.HandlerAdapter
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidafterExecute(org.springframework.web.method.HandlerMethod handlerMethod, java.lang.Object[] args, java.lang.Object returnValue, java.lang.Throwable error, org.springframework.web.context.request.NativeWebRequest request)Interception point after successful execution of aHandlerMethod.voidbeforeExecute(org.springframework.web.method.HandlerMethod handlerMethod, java.lang.Object[] args, org.springframework.web.context.request.NativeWebRequest request)Interception point before the execution of aHandlerMethod.
-
-
-
方法详细资料
-
beforeExecute
void beforeExecute(org.springframework.web.method.HandlerMethod handlerMethod, java.lang.Object[] args, org.springframework.web.context.request.NativeWebRequest request) throws java.lang.ExceptionInterception point before the execution of aHandlerMethod. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.- 参数:
handlerMethod-HandlerMethodargs- the resolved arguments ofHandlerMethodrequest-WebRequest- 抛出:
java.lang.Exception- if any error caused
-
afterExecute
void afterExecute(org.springframework.web.method.HandlerMethod handlerMethod, java.lang.Object[] args, @Nullable java.lang.Object returnValue, @Nullable java.lang.Throwable error, org.springframework.web.context.request.NativeWebRequest request) throws java.lang.ExceptionInterception point after successful execution of aHandlerMethod. Called after HandlerAdapter actually invoked the handler.- 参数:
handlerMethod-HandlerMethodargs- the resolved arguments ofHandlerMethodreturnValue- the return value ofHandlerMethoderror- the error afterHandlerMethodinvocationrequest-WebRequest- 抛出:
java.lang.Exception- if any error caused
-
-