标签:
一、HandlerInterceptor 用法
第一步:注册拦截器
<!-- 注册拦截器 --> <mvc:interceptors> <bean class="com.project.base.interceptor.ControlInterceptor" /> </mvc:interceptors>
第二步:继承HandlerInterceptor ,实现拦截器
public class ControlInterceptor implements HandlerInterceptor{ private static Logger logger = Logger.getLogger(ControlInterceptor.class); /** * 执行完控制器后调用,即离开时 */ @Override public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object arg2, Exception arg3) throws Exception { logger.info("className--->" + arg2); logger.info("request--->" + request); }}
springMVC 拦截器 HandlerInterceptor 用法
标签:
原文地址:http://my.oschina.net/fengshuzi/blog/364397