public class AuthorityMethodInterceptor extends MethodFilterInterceptor {
private int authorityId;
public void setAuthorityId(int authorityId) {
this.authorityId = authorityId;
}
.....}
每次程序运行会自动扫描Struts.xml 将<param name="authorityId">19</param> 的值setter 到拦截器里面 但是触发到action 时候就不会 将值setter进去。。 有执行拦截器。。 求解啊
private int authorityId;
public void setAuthorityId(int authorityId) {
this.authorityId = authorityId;
}
.....}
每次程序运行会自动扫描Struts.xml 将<param name="authorityId">19</param> 的值setter 到拦截器里面 但是触发到action 时候就不会 将值setter进去。。 有执行拦截器。。 求解啊
<!-- 定义统一认证拦截器 -->
<interceptor name="authInterceptor" class="com.hxrainbow.crm.util.ReInterceptor"/>
<interceptor-stack name="authInterceptorStack">
<!-- struts缺省拦截器 -->
<interceptor-ref name="defaultStack"/>
<!-- 统一认证拦截器 -->
<interceptor-ref name="authInterceptor"/>
</interceptor-stack>
</interceptors>
<!-- 定义为缺省拦截器 -->
<default-interceptor-ref name="authInterceptorStack"/>
但是它只是程序运行的时候才传进去 但是当我
<action name="ListShareCategoryAction" class="ShareFileAction"
method="listShareCategory">
<interceptor-ref name="authStack">
<param name="authorityMethod.authorityId">19</param>
</interceptor-ref>
使用ListShareCategoryAction的时候 被拦截器拦截到 但是 一直没调用到setAuthorityId方法。。
清楚点了???
不要定义为全局的! 你可以在初始化的时候定义个,不要在action里面操作了!