Spring中常用类型的bean配置(Map,List,Set,基本类型)

给自己做个笔记…

有时会用到配置文件中配置一下映射关系,方便以后扩展.此时可采用集合类型的bean配置方式配置.程序中直接注入即可.
Spring中常用类型的bean配置(Map,List,Set,基本类型)_第1张图片
map类型的:



    
        
            
            
            
            
        
    




    
    
    
    

List类型的:



    
        
            [email protected]
            [email protected]
            [email protected]
            [email protected]
        
    




    [email protected]
    [email protected]
    [email protected]
    [email protected]

Set类型的:



    
        
            [email protected]
            [email protected]
            [email protected]
            [email protected]
        
    



    [email protected]
    [email protected]
    [email protected]
    [email protected]

基本类型的(int举例,其它同理):

  
      

  
      

https://www.cnblogs.com/chyu/p/5207994.html

你可能感兴趣的:(Spring中常用类型的bean配置(Map,List,Set,基本类型))