Filter implements Filter 可以拿到原始http请求的信息,但是拿不到处理方法的信息
init(FilterConfig filterConfig)
doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
destroy()
Interceptor
implements HandlerInterceptor
可以拿到原始http请求的信息,也可以拿到处理方法的信息,但是拿不到方法的参数值
preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView arg3)
afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception exception)
网友评论