zoukankan      html  css  js  c++  java
  • 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中指定方法的拦截

  • 相关阅读:
    bzoj1257
    bzoj1833
    bzoj3505
    bzoj2226
    bzoj1263
    bzoj2429
    bzoj1854
    bzoj3555
    bzoj1877
    放两个模版
  • 原文地址:https://www.cnblogs.com/mibing/p/8793464.html
Copyright © 2011-2022 走看看