java 拦截器

1 如果一个action实现了preparable接口,则prepare拦截器会在执行execute方法之前先执行prepare()方法

2  timer 拦截器的功能是输出调用Action所需要的时间,它记录了execute方法和在timer后面定义的其他拦截器的intercept方法执行时间之和,单位为毫秒

3 自定义拦截器的实现:

    如果实现com.opensymphone.xwork2.interceptor.Interceptor接口则需要实现init,destroy,intercept三个方法

    如果继承abstractInterceptor抽象类,只需要覆盖intercept方法即可

  

4 自定义的拦截器如果继承了MethodFilterInterceptor类,则可实现对action中指定方法的拦截

原文地址:https://www.cnblogs.com/mibing/p/8793464.html