您的位置:首页 > 其它

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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐