Is having two definition for a bean (with same name and class) valid in Spring IOC ?
I am having two bean definition files included in web.xml. See the sample below.
applicationContext-beans1.xml
<bean name="myWao"
class="com.beans.myBean">
</bean>
applicationContext-beans2.xml
<bean name="myWao"
class="com.beans.myBean">
</bean>
I am not facing any issue till now. But, will this possibly impact in the real environment which will be multi threaded and clustered ?
Note: Both the XMLs are loaded as I am able to use the other beans defined(only once) in both the XMLs
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…