spring-framework.pdf

Page : 32 (33)

In the equivalent code snippet for idref element property is wrongly set using the value attribute. Instead it should be set using ref attribute.

Context:

<bean id="theTargetBean" class="..."/>
<bean id="theClientBean" class="...">
  <property name="targetName">
    <idref bean="theTargetBean"/>
  </property>
</bean>

Existing code:

<bean id="theTargetBean" class="..." />
<bean id="client" class="...">
    <property name="targetName" value="theTargetBean"/>
</bean>

Proposed Code:

<bean id="theTargetBean" class="..." />
<bean id="client" class="...">
   <property name="targetName" ref="theTargetBean"/>
</bean>

Comment From: sbrannen

Hi @kumaraman528,

Good catch, and congratulations on submitting your first GitHub issue ever! 👍

I've fixed the example in 6.1.x and main.

Cheers,

Sam

Comment From: kumaraman528

Thankyou @sbrannen