1、創(chuàng)建自定義攔截器xxxIntercepter implements HandlerIntercepter

2、重寫HandlerIntercepter的preHandle、postHandle、afterComplate方法。在preHandle方法中可以通過request參數(shù)獲取session,請求接口路徑等信息??梢栽诖诉M行統(tǒng)一請求日志記錄、鑒權、session處理等

3、創(chuàng)建配置類 xxxConfig extends WebMvcConfigurationSupport,并加上@Configuration
