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

    <!--以下代码放在Struts的配置文件里-->

    <package name="wapMemberPackage" extends="struts-default">
            <!-- Defined myself interceptors -->
            <interceptors>
                <interceptor name="paginationInterceptor" class="com.juming.interceptor.PaginationInterceptor"/>
                <interceptor name="frontMemberInterceptor" class="com.juming.interceptor.FrontMemberInterceptor"/> //拦截器类
                <interceptor-stack name="MyDefaultInterceptor">
                    <interceptor-ref name="defaultStack" />
                    <interceptor-ref name="paginationInterceptor" />
                    <interceptor-ref name="frontMemberInterceptor" />
                </interceptor-stack>
            </interceptors>
            <default-interceptor-ref name="MyDefaultInterceptor" />
            <global-results> //全局返回值 必须放在所有action之上
                <result name="login">/WEB-INF/jsp/template/wap/login.jsp</result>
                <result name="error">/WEB-INF/jsp/template/wap/error.jsp</result>
            </global-results>
            <action name="wapm_*" method="{1}" class="com.juming.action.frontMemberAction">
                <result name="success">/WEB-INF/jsp/template/wap/index.jsp</result>
            </action>
        </package>

  • 相关阅读:
    深入理解Http协议
    Http协议详解
    过滤器、监听器、拦截器的区别
    HTTP状态代码集
    理解XML-RPC
    Axis2 解析
    REST SOAP XML-RPC分析比较
    Spring 第一天课程
    Spring 框架学习 有用
    数据库主从复制,读写分离,负载均衡,分表分库的概念 没用
  • 原文地址:https://www.cnblogs.com/wdlove/p/4499733.html
Copyright © 2011-2022 走看看