Spring Getting Started (5) iterating through various collections in spring

Source: Internet
Author: User
Tags set set xmlns

Spring-collection.xml

<?xml version= "1.0" encoding= "UTF-8"?> <beans xmlns= "Http://www.springframework.org/schema/beans" Xmlns:xs  
           I= "Http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation= "Http://www.springframework.org/schema/beans Http://www.springframework.org/schema/beans/spring-beans.xsd "> <!--Spring Container is responsible for creating, managing, maintaining beans and being able to rely on injection into the corresponding Component--> <bean id= "Collectionbean" class= "Www.csdn.spring.collection.set.CollectionBean" scope= "singleton" lazy  
                -init= "Default" > <!--Set set--> <property name= "Sets" > <set> <value> Zeng Hongjun </value> <value> Army brother </value> <value> haha  
                </value> <value> hehe </value> <value> Hey </value> 
    <value> washing </value> </set> </property> <!--list collection--> <property name= "USERs "> <!--<list> <ref bean=" u1 "/> <ref bean=" U2 "/>   
            <ref bean= "U3"/> <ref bean= "U4"/> </list>--> <array>  
            <ref bean= "U1"/> <ref bean= "U2"/> <ref "bean=" U3 <ref bean= "U4"/> </array> </property> <!--map--> <property Name= "Map" > <map> <entry key= "1" value-ref= "U1" ></entry> <en Try key= "2" > <ref bean= "U2"/> </entry> <entry key= "3" Val  
          
    ue-ref= "U3" > </entry> </map> </property>  
            <property name= "Props" > <props> <prop key= "1" >jdbc:oracle</prop> <prop key= "2" &Gt;jdbc:mysql</prop> <prop key= "3" >jdbc:access</prop> </props> </ property> </bean> <bean id= "U1" class= "Www.csdn.spring.collection.set.User" > <prop Erty name= "name" value= "Deep"/> <property name= "age" value= ""/> </bean> <bea  
        N id= "U2" class= "Www.csdn.spring.collection.set.User" > <property name= "name" value= "Deepsoul"/> <property name= "Age" value= "></property> </bean> <bean id=" U3 "class=" www.csdn.sp Ring.collection.set.User "> <property name=" name value= "CHRP"/> <property "age" Val Ue= "/>" </bean> <bean id= "U4" class= "Www.csdn.spring.collection.set.User" > &LT;PR  
          
          
      
Operty name= "name" value= "Redarmy"/> <property name= "age" value= "/>" </bean> &Lt;/beans> 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.