實作 HandlerInterceptor 介面,實現 preHandle、postHandle 和 afterCompletion 方法。
通過配置加入攔截器,實現 WebMvcConfigurer 介面,覆寫 addInterceptors 方法。
ServletContextListener > Filter >
Interceptor > AOP > 具體執行的方法 > AOP > @ControllerAdvice > Interceptor
> Filter > ServletContextListener
https://www.chainnews.com/zh-hant/articles/444319414168.htmarrow-up-right
Last updated 5 years ago