@Configuration public class FeichaoMvcConfig extends WebMvcConfigurerAdapter { @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(new HandlerInterceptor() { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { System.out.println("公众号:肥朝(id:feichao_java),preHandle"); return true; } public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { System.out.println("公众号:肥朝(id:feichao_java),postHandle"); } public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { System.out.println("公众号:肥朝(id:feichao_java),afterCompletion"); } }); } }
111111111111111111111111111111111111111 1 1 1111111111111111 1 1 1111111111111111111