因为struts2要求:当为action配置了自定义拦截器之后默认拦截器则失效,所以必須手动配置默认拦截器。
<!-- 配置用户的默认的拦截器栈 -->
<package name="packageA" namespace="/book" extends="baseBook">
<action name="createBook" class="bookBean" method="creatBook">
<result name="success">/success.jsp</result>
<interceptor-stack name="userAuth">
<interceptor-ref name="defaultStack" />
</action>
</package>
<!-- 配置用户的默认的拦截器栈 -->
<package name="packageA" namespace="/book" extends="baseBook">
<action name="createBook" class="bookBean" method="creatBook">
<result name="success">/success.jsp</result>
<interceptor-stack name="userAuth">
<interceptor-ref name="defaultStack" />
</action>
</package>