newbie: <lists> versus <util:list>
来源:互联网 发布:淘宝网页版回收站 编辑:程序博客网 时间:2024/06/06 09:54
I want to initialize a list property in proper Spring 2 fashion. Should I be using <util:list>? What's the syntax?
Here's the way I used to do it:
The following works, but I'd rather not have to separate the list -- can't I embed the list right in the using bean, as in the example above?
Here's the way I used to do it:
Code:
<bean id="snowWhite" class="Person"> <property name="friends"> <list> <value>Sleepy</value> <value>Grumpy</value> <value>Bashful</value> </list> </property><bean>
Code:
<bean id="snowWhite" class="Person"> <property name="friends" ref="dwarfFriends"/><bean><util:list id="dwarfFriends"> <value>Sleepy</value> <value>Grumpy</value> <value>Bashful</value></util:list>
Thanks!
Hi Debe
You can (and should) keep on doing it the 'old' way.
The <util:list/> element is for defining a top level, shared List that you want to inject into numerous objects.
Cheers
Rick
0 0
- newbie: <lists> versus <util:list>
- Lists是google对java.util.List类的封装
- Reading List for Computer Vision Newbie
- Lists数组转换list
- List::Util 和 List::MoreUtil
- java.util.List翻译
- java.util.List学习
- java.util.list操作
- java.util.List
- java.util.List学习
- java.util.List.subList
- java.util.List.subList
- List java.util.ConcurrentModificationException
- java.util.List
- spring </util:list>使用
- java.util.List.subList
- java List转List Lists.transform
- java List转List Lists.transform 进阶
- 冒泡排序
- Spring中配置和读取多个Properties文件
- 快速排序
- Spring通过@Value注解注入属性的几种方式
- 论文笔记 | VERY DEEP CONVOLUTIONAL NETWORKS FOR LARGE -SCALE IMAGE RECOGNITION
- newbie: <lists> versus <util:list>
- 编译原理 核心理论基础-摘自清华大学编译原理第3版
- property和constructor-arg的使用
- [转载]有向图的最小生成树,最小树形图
- JAVA中的URI,URL,URN(转)
- PD003-NET通用后台系统
- 【解题报告】Codeforces Round #360 (Div. 2)
- leetcode 148. Sort List
- ulimit命令