【问题标题】:Hybris interceptor is not getting triggeredHybris 拦截器没有被触发
【发布时间】:2020-05-23 12:33:24
【问题描述】:

我在下面的路径中创建 ValidateInterceptor 并在 custombackoffice-backoffice-spring.xml 中创建 bean

C:\hybris\bin\custom\custombackoffice\backoffice\src\com\custom\backoffice\interceptor\CustomAppeasementUserValidateInterceptor.java

bean 如下

<bean id="customAppeasementUserValidateInterceptor" class="de.hybris.platform.servicelayer.interceptor.impl.InterceptorMapping">
    <property name="interceptor" ref="customAppeasementUserValidateInterceptor" />
    <property name="typeCode" value="Appeasement" />
</bean>

当我在后台修改特定模型并单击保存按钮时,调试器永远不会进入拦截器它直接保存模型。

注意:- 我无法在 customcore 中编写此拦截器,因为我们无法在自定义核心中导入以下服务 导入 com.hybris.cockpitng.core.user.AuthorityGroupService; 导入 com.hybris.cockpitng.core.user.impl.AuthorityGroup;

为什么拦截器没有被触发?

【问题讨论】:

  • 你能告诉我们来自 xml 的 customAppeasementUserValidateInterceptor bean 配置吗?和类声明。

标签: interceptor hybris backoffice


【解决方案1】:

bean-idmapper bean-id 是一样的。改变任何一个。理想情况下,它应该是-

<bean id="customAppeasementUserValidateInterceptorMapping" class="de.hybris.platform.servicelayer.interceptor.impl.InterceptorMapping">
    <property name="interceptor" ref="customAppeasementUserValidateInterceptor" />
    <property name="typeCode" value="Appeasement" />
</bean>

注意 mapping bean 的新 id,即 customAppeasementUserValidateInterceptorMapping

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多