Skip to content

Fix XML bean reference example in reference manual #33855

Closed
@kumaraman528

Description

@kumaraman528

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>

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions