1. 写一个拦截器,实现@HandlerInterceptor,放入spring,@component 。
2. 写webConfig, 实现@WebMvcConfiguration,注入拦截器,重写addInterceptors方法,在里面配置拦截器路径。
1. 写一个拦截器,实现@HandlerInterceptor,放入spring,@component 。
2. 写webConfig, 实现@WebMvcConfiguration,注入拦截器,重写addInterceptors方法,在里面配置拦截器路径。