Skip to Content
1
Sep 01, 2021 at 03:23 PM

How the "InterceptorMapping" works internally and what spring concept behind this kind approach?

572 Views Last edit Dec 03, 2021 at 01:09 PM 2 rev

I have created a custom interceptor and added the mapping in *spring.xml file as below,

1. Created the bean id for the customInterceptor class

<bean id="myValidateInterceptor" class ="*.MyValidateInterceptor">

</bean>

2.Then we will register the above customInterceptor class as a property into InterceptorMapping class as below

<bean id="MyValidateInterceptorMapping"

class ="de.hybris.platform.servicelayer.interceptor.impl.InterceptorMapping">

<property name="interceptor" ref="myValidateInterceptor"/>

<property name="typeCode" value="MyType"/>

</bean>

My question is how the "InterceptorMapping" works internally and which spring concept behind this kind of approach?

Kindly explain.

Thanks