zoukankan      html  css  js  c++  java
  • Struts2的拦截器配置

    1:引入默认的时间拦截器

        <!-- 引入拦截器和引入拦截器栈一样的语法 -->

         <interceptor-ref name="defaultStack"></interceptor-ref>

                <!-- 引入时间拦截器 -->

         <interceptor-ref name="timer"></interceptor-ref>

    2:自定义时间拦截器的引(引入package标签中)

    <!-- 自定义拦截器栈 -->

         <interceptors>

    <interceptor-stack name="myStack">

    <!-- 配置时间拦截器 -->

         <interceptor-ref name="timer"></interceptor-ref>

         <!-- 引入默认的拦截器 -->

         <interceptor-ref name="defaultStack"></interceptor-ref>

    </interceptor-stack>     

         </interceptors> 

    ation中引入自定义的拦截器栈

    <interceptor-ref name="myStack"></interceptor-ref>

    3: 自定义拦截器栈的引入

    <!-- 自定义拦截器栈 -->

         <interceptors>

         <!-- 自定义拦截器类 -->

         <interceptor name="my01" class="com.baidu.intercept.MyIntercept01"></interceptor>

        

         <!-- 引入拦截器 -->

    <interceptor-stack name="myStack">

    <interceptor-ref name="my01"></interceptor-ref>

    <!-- 引入默认的拦截器 -->

         <interceptor-ref name="defaultStack"></interceptor-ref>

    </interceptor-stack>     

     </interceptors> 

    ation中引入自定义的拦截器栈

    <interceptor-ref name="myStack"></interceptor-ref>

    也可将<interceptor-ref name="myStack"></interceptor-ref>此配置转化成<default-interceptor-ref name="myStack"></default-interceptor-ref>

    山重水复疑无路,柳暗花明又一村! 专注填坑,少走弯路!
  • 相关阅读:
    day11 函数的进阶
    day10 文件的补充以及函数
    day9 文件处理
    day8 字典的补充以及集合
    Vue学习下
    前端常用js方法集
    js实现千位符格式化
    Vue项目总结上
    VUE项目github
    http://www.jianshu.com/p/42e11515c10f#
  • 原文地址:https://www.cnblogs.com/mqflive81/p/10645019.html
Copyright © 2011-2022 走看看