简体   繁体   中英

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>

您可以在拦截器中包含条件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM