I defined two beans for a same class with different id names in applicationContext.xml. It working perfectly, so I got confused what is exact Spring singleton scope mean. I gone through some other similar questions in Stack Overflow. But I am not clear because those not exactly same context and very long explanation.
I read that single instance for container (context). In my case, is it creating two containers for my two instances?
My code is below:
<bean id="a1" class="com.myapp.Address">
<constructor-arg value="ghaziabad"></constructor-arg>
<constructor-arg value="UP"></constructor-arg>
<constructor-arg value="India"></constructor-arg>
</bean>
<bean id="a2" class="com.myapp.Address">
<constructor-arg value="Delhi"></constructor-arg>
<constructor-arg value="DOWN"></constructor-arg>
<constructor-arg value="India"></constructor-arg>
</bean>
<bean id="e" class="com.myapp.Employee">
<constructor-arg value="12" type="int"></constructor-arg>
<constructor-arg value="Sonoo"></constructor-arg>
<constructor-arg>
<ref bean="a1" />
</constructor-arg>
</bean>
<bean id="e2" class="com.myapp.Employee">
<constructor-arg value="12" type="int"></constructor-arg>
<constructor-arg value="Sonoo"></constructor-arg>
<constructor-arg>
<ref bean="a2" />
</constructor-arg>
</bean>