Spring beans.xml: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 12: Line 12:


     <bean name="blue" class="playground.spring.ioc.Blue">
     <bean name="blue" class="playground.spring.ioc.Blue">
         <constructor-arg value = "something" />
         <constructor-arg value = "something"/>
         <constructor-arg ref = "red" />
         <constructor-arg ref = "red"/>
     </bean>
     </bean>


     <bean name="red" class="playground.spring.ioc.Red">
     <bean name="red" class="playground.spring.ioc.Red">
         <constructor-arg value = "something else" />
         <constructor-arg value = "something else"/>
     </bean>
     </bean>


</beans>
</beans>
</syntaxhighlight>
</syntaxhighlight>

Revision as of 19:20, 4 November 2018

Internal

Example

<?xml version="1.0" encoding="UTF-8"?>
<!--suppress SpringFacetInspection -->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean name="blue" class="playground.spring.ioc.Blue">
        <constructor-arg value = "something"/>
        <constructor-arg ref = "red"/>
    </bean>

    <bean name="red" class="playground.spring.ioc.Red">
        <constructor-arg value = "something else"/>
    </bean>

</beans>