Refer a property of another bean in Spring 2.5.X

52 views Asked by At

In Spring 3.0 and higher it is possible to refer a property of another bean as below.

<bean id="a" class="A">
    <property name="list"
        value="#{b.list}"/>
</bean>

Is there a way I can refer property of another bean in Spring 2.5.1. Note that Spring Expression integrated after Spring 3.0

1

There are 1 answers

1
Amit Bhati On

Spring is a framework for dependency injection and not for value injection. If your bean a has dependency on bean b for its creation, then why not inject the bean b in bean a.

Spring do give limited feature for injecting values but that is only for configuring the components i.e. beans.