今天突然想写个登陆拦截器 由于使用的是Struts Interceptors所以看了下文档 其实很简单 分为3步
第一步:实现Interceptor接口 实现方法即可 其中比较重要的是ActionInvocation的方法
其中常用的方法为:
<interceptors>
<interceptor name="logger" class="com.ql.core.intercepto.impl.UserIntercepto"/>
<interceptor-stack name="myStack">
<interceptor-ref name="logger"/>
</interceptor-stack>
</interceptors>
若参数丢失
<interceptor-ref name="myStack"/>
<interceptor-ref name="defaultStack"/>