Struts2配置拦截器

时间:2023-01-10 17:14:55
<package name="loginaction" namespace="/" extends="struts-default">
<interceptors>
<interceptor name="myintercepter" class="interceper.LoginInterceper"></interceptor>
<interceptor-stack name="mystack">
<interceptor-ref name="defaultStack"></interceptor-ref>
<interceptor-ref name="myintercepter"></interceptor-ref>
</interceptor-stack>
</interceptors> <action name="book" class="action.BookAction">
<interceptor-ref name="mystack"></interceptor-ref>
<result name="add">/index.jsp</result>
<result name="delete">/index.jsp</result>
<result name="update">/index.jsp</result>
<result name="input">/login.jsp</result>
</action>
</package>