Bean configuration in Spring

I have two beans configured in spring following way. I am giving the pseudo code as below

 <beans>    <bean id="a" class="Employee">    <property name="b">    <bean id="b" class="Department">     <property name="a">  </beans> 

What happens in this case. I think the configuration works fine. Correct me if i am wrong.

I would like to know if i can configure beans in such a way. If it not proper then what exception it throws


You lack a closing quote on Employee class. Also, use a ref attribute to attach another bean to a bean's property. Here's the fix:

   <bean id="a" class="Employee">
   <property name="b" ref="b">
   <bean id="b" class="Department">
    <property name="a" ref="a">

Category: java Time: 2016-07-31 Views: 74
Tags: java spring

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.284 (s). 13 q(s)