`

Spring Properties List Set Map

阅读更多

<!-- list -->
<property name="users">
<list>
<ref bean="u1"/>
<ref bean="u2"/>
<ref bean="u3"/>
<ref bean="u4"/>
<ref bean="u5"/>
</list>
</property>
<!-- set -->
<property name="sets">
<set>
<value>赵薇</value>
<value>林心如</value>
<value>李宇春</value>
<value>苏有朋</value>
<value>范冰冰</value>
</set>
</property>

<!-- map -->
<property name="map">
<map>
<entry key="1" value-ref="u1"/>
<entry key="2">
<ref bean="u2"/>
</entry>
<entry key="3" value-ref="u3"/>
<entry key="4" value-ref="u4"/>
<entry key="5" value-ref="u5"/>
</map>
</property>

private Properties props;
<!-Properties ->
<property name="props">
<props>
<prop key="1">zhangsan</prop>
<prop key="2">lisi</prop>
<prop key="3">wangwu</prop>
</props>
</property>

分享到:
评论

相关推荐

    Spring的一些配置信息(date map and so on)

    Spring的一些配置信息(date map and so on) Spring Date Map List Set Properties 自己写了一个属性编辑器,主要对Date型数据进行操作

    spring.doc

    3.5.3 装配list集合 22 3.5.4 装配set集合 22 3.5.5 装配map 22 3.5.6 装配Properties 23 3.6 注解注入 23 注解注入拓展: 23 3.6.1 @Autowired 26 3.6.2 @Qualifier 27 3.6.3 @Resource 27 3.6.4 @PostConstruct 28...

    Spring装配集合属性

    在Spring中可以装配4种集合类型属性:List、set、Map和Properties。与这四种集合对应的标签是、、、。CollectionBean是一个包含上述4种集合类型的JavaBean,代码如下:

    Spring-Reference_zh_CN(Spring中文参考手册)

    velocity.properties 14.4.4.2. FreeMarker 14.4.5. 绑定支持和表单处理 14.4.5.1. 用于绑定的宏 14.4.5.2. 简单绑定 14.4.5.3. 表单输入生成宏 14.4.5.4. 重载HTML转码行为并使你的标签符合XHTML 14.5. XSLT ...

    springDay1

    spring构造参数,set方法,类对象属性的注入,还有数组,list,map,properties对象的依赖注入。

    springmybatis

    public void setId(int id) { this.id = id; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserAge()...

    带有外部定义集合命名空间的Spring配置文件

    该xml文件不仅仅是Spring框架初次使用时的主配置文件,而且该文件里面包含了java.util里面的List,Set,Map,Properties等的命名空间,支持在配置文件中定义外部的集合,便于参数注入的复用性

    springboot 的配置文件加载顺序

    springboot 的配置文件加载顺序 ... 本系列校训 用免费公开视频,卷飞培训班哈人!打死不报班,赚钱靠狠干!...YAML 对象、数组、List、Map、Set的行内写法与缩进写法 YAML 位置 第一个位置 第二个位置 其它位置

    装配bean—集合类型注入值源码

    装配bean——集合类型注入值: 本文介绍数组、list集合、set集合、map集合、properties的注值 博客原文地址:http://blog.csdn.net/tingzhiyi/article/details/52104203

    cms后台管理

    protected List&lt;Content&gt; getList(Map, TemplateModel&gt; params, Environment env) throws TemplateException { Integer[] ids = DirectiveUtils.getIntArray(PARAM_IDS, params); if (ids != null) { //根据内容...

    单点登录源码

    SpringMVC | MVC框架 | [http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc](http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc) ...

    springmvcmybatis

    &lt;property name="location" value="classpath:jdbc.properties" /&gt; &lt;!-- ${jdbc.driver}" /&gt; ${jdbc.url}" /&gt; ${jdbc.username}" /&gt; ${jdbc.password}" /&gt; 初始化连接大小 ${jdbc.initialSize}...

    Java JDK 7学习笔记(国内第一本Java 7,前期版本累计销量5万册)

    著作:《java jdk 5.0学习笔记》、《java se 6技术手册》、《spring技术手册》等 译作:《ajax实战手册》、《jquery实战手册(第2版)》 个人网站:http://openhome.cc 目录 《java jdk 7学习笔记》 chapter1 ...

    java基础题 很全面

    11. Spring transaction properties 29 编程/代码 30 1. 编程题: 用最有效率的方法算出2乘以8等於几? 30 2. 我们在web应用开发过程中经常遇到输出某种编码的字符,如iso8859-1等,如何输出一个某种编码的字符串? 30 3....

Global site tag (gtag.js) - Google Analytics