tags:

views:

434

answers:

1

Can someone tell me the difference and which one has to be used when ?

<bean id="b1" class="" />

<bean id="" class="">
 <property name="b1" ref="b1" />
</bean>

    vs

<bean id="" class="">
 <property name="b1" idref="b1" />
</bean>
+3  A: 

"ref" is used to pass the bean that the ref refers to. "idref" is used to pass the name of the bean (as a String) that is referred to.

http://forum.springsource.org/showthread.php?t=74355

Kaleb Brasee