R
rmn190
my before understanding of the that is:
by value,we mean that what we want inject is primitives or
String,while with ref,what we want to inject is self-difined objects.
but i find some different today when i reread the Spring
document(version is spring-framework-2.0.6),in the section of
"3.3.3.1.1. The idref element",there is an example to explain the
idref element,it is :
<bean id="theTargetBean" class="..."/> ---(1)
<bean id="client" class="...">
<property name="targetName">
<value>theTargetBean</value>
</property>
</bean>
</bean>
and
<bean id="theTargetBean" class="..."/> ---(2)
<bean id="client" class="...">
<property name="targetName">
<idref bean="theTargetBean" />
</property>
</bean>
</bean>,
and the docs says:
bean definition snippet (2) is exactly equivalent (at runtime) to
the snippet (1).
could you help with that?
by value,we mean that what we want inject is primitives or
String,while with ref,what we want to inject is self-difined objects.
but i find some different today when i reread the Spring
document(version is spring-framework-2.0.6),in the section of
"3.3.3.1.1. The idref element",there is an example to explain the
idref element,it is :
<bean id="theTargetBean" class="..."/> ---(1)
<bean id="client" class="...">
<property name="targetName">
<value>theTargetBean</value>
</property>
</bean>
</bean>
and
<bean id="theTargetBean" class="..."/> ---(2)
<bean id="client" class="...">
<property name="targetName">
<idref bean="theTargetBean" />
</property>
</bean>
</bean>,
and the docs says:
bean definition snippet (2) is exactly equivalent (at runtime) to
the snippet (1).
could you help with that?