Using standalone collection in xml

To use standalone collection use

xmlns:util ="http://www.springframework.org/schema/util"

along with its schema location:

 http://www.springframework.org/schema/util

 http://www.springframework.org/schema/util/spring-util.xsd
After this simply use in .xml file like this:

 <util:list list-class="java.util.LinkedList" id="myBestFriends">

    <value>Tore</value>
<value>Amrit</value>
<value>Arun</value>
</util:list>

<bean class="com.mountech.collection.Person" name="person">
<property name="friends">
<ref bean="myBestFriends"/>
</property>

</bean>

Comments

Popular posts from this blog