0

I create ValidateInterceptor in below path and created bean in custombackoffice-backoffice-spring.xml

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

bean is as below

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

when I modify particular model in backoffice and click on the save button, debugger never goes to interceptor it directly saves the model.

NOTE :- I can't write this interceptor in customcore because we can not import below services in custom core import com.hybris.cockpitng.core.user.AuthorityGroupService; import com.hybris.cockpitng.core.user.impl.AuthorityGroup;

Why the interceptor is not getting triggered?

Farrukh Chishti
  • 7,652
  • 10
  • 36
  • 60
user3809154
  • 53
  • 2
  • 6
  • Can you show us the `customAppeasementUserValidateInterceptor` bean configuration from xml ? and the class declaration. – user1234SI. Feb 07 '20 at 13:02

2 Answers2

0

The bean-id and the mapper bean-id are the same. Change either one. Ideally, it should be like-

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

Notice the new id for the mapping bean i.e. customAppeasementUserValidateInterceptorMapping.

Farrukh Chishti
  • 7,652
  • 10
  • 36
  • 60
0

have you done an update system from the hac or using the ant tasks? I believe interceptors need an update to be registered on the type.

rustyfinger
  • 199
  • 2
  • 7