Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下情况:
我将bean(在applicationContext.xml中)设置如下:
... <bean id="bDaoImpl" class="BDaoImpl"></bean> <bean id="injBInA" class="ADaoImpl"> <property name="b" ref="bDaoImpl"/> </bean> ...
为什么当我在 Object 类 ADaoImpl 的值中使用“b”时为空?
我有解决办法。对不起。基本上,当我从应用程序上下文(ApplicationContext.getBean)加载bean时,不会加载id =“injBInA”的bean,因此从未进行过注入