<package name="user" extends="struts-default">
<action name="userinfoAction" class="test.UserinfoAction">
</action>
</package>
<interceptors>
<!-- 给自定义的拦截器取名为userinfoInterceptor -->
<interceptor name="userinfoInterceptor" class="com.ruicaiedu.action.UserinfoInterceptor"</interceptor>
<!--多个拦截器命名为myInterceptorStack-->
<interceptor-stack name="myInterceptorStack">
<!--写入自定义拦截器userinfoInteceptor,加上系统自带的defaultStack-->
<interceptor-ref name="userinfoInteceptor"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
</interceptor-stack>
<action name="userinfoAction" class="test.UserinfoAction">
<result>index.jsp</result>
<!-- 加拦截器,让myInterceptorStack拦截userinfoAction -->
<interceptor-ref name="myInterceptorStack"></interceptor-ref></action>
</package>