posted 19 years ago
A bean can be given more than one name so that it can be referred by using different aliases.When using local attribute it means <ref> tag only looks at the bean's id and never at any of its aliases .When injecting a bean by name,the bean attribute of the <ref> tag is used.
<bean id ="injRef" class="com.myPac.ClassA">
<property name="abc">
<ref bean ="good"/>
</property>
</bean>
<bean id="abc" name ="good" class=com.myPac.ClassB"/>
Here 'abc'bean is given an alias using the 'name' attribute and it is injected into intRef bean by uing this alias in conjuction with the bean attribute of the <ref> tag.
[ May 16, 2005: Message edited by: Amer Khan ]
<i>Dare to dream - everything that exists today,was once a figment of someone's imagination, nobody says tomorrow can't be a figment of your today.</i>