<package name="default" namespace="/" extends="struts-default">
<!-- 拦截器信息-->
<interceptors>
<interceptor name="login" class="com.yojosources.interceptor.UserInterceptor"></interceptor>
<interceptor-stack name="myStack">
<interceptor-ref name="defaultStack"></interceptor-ref>
<interceptor-ref name="login" ></interceptor-ref>
</interceptor-stack>
</interceptors>
<!-- 配置默认的拦截器 -->
<default-interceptor-ref name="myStack" />
<!-- 全局变量,超时返回登录页面 -->
<global-results>
<result name="welcome">/index.html</result>
<result name="login" type="redirectAction">userAction!login</result>
</global-results>
</package>
<package name="user" extends="default" namespace="/">
<action name="userAction" class="userAction">
<result name="success">/jsp/user/list.jsp</result>
<result name="loginOut">/yojo-admin/index.jsp</result>
<result name="loginOutBusiness" >/business/index.jsp</result>
<result name="loginOutGamescenter" >/yojo-gamescenter/index.jsp</result>
<result name="home">/yojo-business/basic/home.jsp</result>
</action>
</package>
参考网址,见:http://www.blogjava.net/i369/articles/162407.html。
自定义拦截器要实现Interceptor 接口。