Java Spring Boot VS .NetCore (十) Java Interceptor vs .NetCore Interceptor
这篇主要说下拦截器的处理,这里就说下org.springframework.web.servlet 下的HandlerInterceptor Java Interceptor 通过HandlerInterceptor类来看下代码 public interface HandlerInterceptor { boolean preHandle(HttpServletRequest var1, HttpServletResponse var2, Object var3) throws Exception; void postHandle(HttpServletRequest var1, HttpServletResponse var2, Object var3, ModelAndView var4) throws Exception; void afterCompletion(HttpServletRequest var1, HttpServletResponse var2, Object var3, Exception var4) throws Exception; } 拦截器的处理就在,三个方法的意思一看就明白,也不做过多介绍 那么在代码中我们怎么来处理这些呢? 这里又要结合前面的章节 Filter 接口在处理了,对什么进行拦截