代码如下:

<interceptors>
 <!-- 注册自定义拦截器 -->
   <interceptor name="LoginInterceptor" class="com.hncj.crm.staff.web.action.LoginInterceptor"></interceptor>
   <!--自定义栈  -->
   <interceptor-stack name="crmStaff">
    <interceptor-ref name="struts-default"></interceptor-ref>
    <interceptor-ref name="LoginInterceptor">
         <param name="excludeMethods">login</param>
    </interceptor-ref>
   </interceptor-stack>
 </interceptors>
 <!--将自定义的拦截器栈设置为默认的拦截器栈  -->
 <default-interceptor-ref name="crmStaff"></default-interceptor-ref>

**********************************************************************************

解决办法:默认的配置自定义栈中的引用默认拦截器出错   

应该改为:

<interceptor-ref name="defaultStack"></interceptor-ref>

-----------------------------------------------------------------------------------------------------

excludeMethods的好处是排除某一个方法不进行拦截,比如登陆时不拦截,其他页面都拦截

注意:访问jsp页面时拦截器是不进行拦截的,当访问《action》时才会拦截

相关文章:

  • 2021-06-22
  • 2021-08-12
  • 2022-01-20
  • 2022-12-23
  • 2021-06-13
  • 2021-10-25
  • 2021-10-08
  • 2021-05-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2022-12-23
相关资源
相似解决方案