开发者

Java Spring anonymous bean without parent

I try to understand code:

<bean id="topBean" class="com.topBean" >
    <property name="helpbean" ref="helpBean" />
    <property name="topFolder">
        <bean parent="someparent">
            <property name="propertyName" value="value1"/>
        </bean>
    </property>
</bean>

I try 开发者_JAVA技巧to find parent bean with name "someparent" but without success. Is it allowed?


There has to be a bean called someParent somewhere in the context, or in a parent context. It's not valid otherwise.

Remember, contexts can themselves have parent contexts. Beans in a child context can refer to bean in their parent contexts.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜