开发者

Spring: problem with setter Dependence Injection

I have the following situation:

Spring: problem with setter Dependence Injection

I set the beans (in applicationContext.xml) as follows:

...
<bean id="bDaoImpl" cl开发者_如何学Cass="BDaoImpl"></bean>
<bean id="injBInA" class="ADaoImpl">
   <property name="b" ref="bDaoImpl"/>
</bean>
...

Why when I use "b" in the value of the Object class ADaoImpl is null?


I have the solution. Sorry. Basically when I load the bean from application context (ApplicationContext.getBean) does not load the bean with id = "injBInA" therefore right was never carried out the injection

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜