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进去。。  有执行拦截器。。  求解啊
       

解决方案 »

  1.   

    加<interceptor-ref name="defaultStack"/>在<action></action>的第一个位置加
      

  2.   

    拦截器必须在配置文件中配置!我想你应该配置了吧,下面是我的配置,你看看<interceptors>
    <!-- 定义统一认证拦截器 -->
    <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"/>
      

  3.   

    <interceptor-ref name="defaultStack"/>  这个我添加  但是我想实现的  将<param name="authorityId">19</param>  中的19 传进去我自己定义的拦截器AuthorityMethodInterceptor  
    但是它只是程序运行的时候才传进去  但是当我
    <action name="ListShareCategoryAction" class="ShareFileAction"
    method="listShareCategory">
    <interceptor-ref name="authStack">
    <param name="authorityMethod.authorityId">19</param>
    </interceptor-ref>
    使用ListShareCategoryAction的时候   被拦截器拦截到  但是 一直没调用到setAuthorityId方法。。
    清楚点了???  
      

  4.   

    你这个貌似所有的都被拦截了! 
    不要定义为全局的!  你可以在初始化的时候定义个,不要在action里面操作了!