Conditionally Apply an Interceptor in Spring
How can I conditionally add myOtherInterceptor below?
<bean id="myService" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"><value>IMyService</value></property>
<property name="target">
<bean parent="baseServiceTarget" class="MyService" />
</property>
<property name="interceptorNames">
<list>
<value>myInterceptor</value>
<value开发者_开发百科>myOtherInterceptor</value>
</list>
</property>
</bean>
You can have the condition within the interceptor.
精彩评论