Webwork操作集合是的两个有趣的特性-投影和筛选
2007-04-16 22:29
1021 查看
假设有类:Children和Mother
Class Children{
private String name;
private int age;
private Mother;
}
Class Mother{
private String name;
}
如果想得到所有age<20的孩子名字,可以在得到孩子列表后,在jsp中这样操作 children.{?#this.age<20},这就是筛选
如果进一步得到学生的名字,只得到名字,可以这样做children.{?#this.age<20}.{name}
下面的操作将用student name->classroom.name的格式输出,例如:gaoxiang->javeEE
<ww:iterator value="#request.student.{name+'->'+classroom.classname}" status="status">
<ww:property value="#request.student.{name+'->'+classroom.classname}.get(#status.index)"/>
</ww:iterator>
Class Children{
private String name;
private int age;
private Mother;
}
Class Mother{
private String name;
}
如果想得到所有age<20的孩子名字,可以在得到孩子列表后,在jsp中这样操作 children.{?#this.age<20},这就是筛选
如果进一步得到学生的名字,只得到名字,可以这样做children.{?#this.age<20}.{name}
下面的操作将用student name->classroom.name的格式输出,例如:gaoxiang->javeEE
<ww:iterator value="#request.student.{name+'->'+classroom.classname}" status="status">
<ww:property value="#request.student.{name+'->'+classroom.classname}.get(#status.index)"/>
</ww:iterator>
相关文章推荐
- 关于Linq对DataTable和List各自的两个集合筛选的相关操作技巧
- 09_Java8操作集合的一些新特性
- JDK 8 新特性学习(二) Lambda表达式、集合流之操作
- java 实现将传入的两个集合进行并,交,联集,差操作
- java集合操作-----求两个集合的交集和并集
- java集合操作-----求两个集合的交集和并集
- 两个集合直接的操作 如何jsp页面迭代遍历,js如何写函数
- 体验Vista三个特性 鲜为人知的有趣操作
- 链表的基本操作(创建,查找指定位置元素,删除指定元素,插入,倒置,去重,求集合的差,分别交换结点与交换结点值实现的冒泡排序,将两个有序链表合并成一个有序链表)c语言实现
- Java8新特性-006-Stream筛选与切片-中间操作
- Java_集合操作_合并两个map
- 假设利用两个线性表La和Lb分别表示两个集合A和B(即线性表中的数据元素即为集合中的成员),现要求一个新的 集合A=AUB。这就要求对线性表作如下操作:扩大线性表La,将存在于线性表Lb中而不存在于线
- java:在Conllection接口中实际上也规定了两个可以将集合变成对象数组的操作
- PHP的两个特性导致waf绕过注入(有趣的知识点)
- javascript 常见数组操作( 1、数组整体元素修改 2、 数组筛选 3、jquery 元素转数组 4、获取两个数组中相同部分或者不同部分 5、数组去重并倒序排序 6、数组排序 7、数组截取slice 8、数组插入、删除splice(需明确位置) 9、数组遍历 10、jQuery根据元素值删除数组元素的方)
- PHP的两个特性导致waf绕过注入(有趣的知识点)
- Linq对DataTable或者集合的排序,Where筛选,分组,统计总数sum等操作
- Linq对DataTable或者集合的排序,Where筛选,分组,统计总数sum等操作
- 从头认识Spring-1.16 SpEl对集合的操作(2)-查询集合以及投影元素集合
- Java1.8新特性关于lambda表达式与Stream流的使用以及对集合的实用操作