Java SpringBeanAutowiringInterceptor-配置为按名称而不是按类型自动连线?
我正在EJB3无状态会话bean中使用Java SpringBeanAutowiringInterceptor-配置为按名称而不是按类型自动连线?,java,spring,ejb-3.0,autowired,Java,Spring,Ejb 3.0,Autowired,我正在EJB3无状态会话bean中使用SpringBeanAutowiringInterceptor,如中所述 在SpringConfig.xml中: <bean id="myCustomService1" class="...MyService"/> <bean id="myCustomService2" class="...MyService"/> 不幸的是,EJB自动连接似乎默认为byType模式,我找不到方法将其更改为byName模式 这可能吗?如果可能,如何实
SpringBeanAutowiringInterceptor
,如中所述
在SpringConfig.xml中:
<bean id="myCustomService1" class="...MyService"/>
<bean id="myCustomService2" class="...MyService"/>
不幸的是,EJB自动连接似乎默认为byType
模式,我找不到方法将其更改为byName
模式
这可能吗?如果可能,如何实现?您是否尝试过使用
限定符
@Autowired
@Qualifier("myCustomService1")
public void setMyCustomService2(MyService svc) {
this.service = svc;
}
您是否尝试过使用限定符
@Autowired
@Qualifier("myCustomService1")
public void setMyCustomService2(MyService svc) {
this.service = svc;
}
@Autowired
@Qualifier("myCustomService1")
public void setMyCustomService2(MyService svc) {
this.service = svc;
}