- 9
- 0
- 约1.33万字
- 约 14页
- 2017-03-20 发布于河南
- 举报
Struts2中使用OGNL表达式投影(过滤)的实战应用
Struts2中使用OGNL表达式投影(过滤)的实战应用1.集合的投影(过滤)有以下三种方式:???? a.“?#”:投影(过滤)所有符合条件的集合,如:users.{?#this.age };???? b.“^#”:投影(过滤)第一个符合条件的元素,如:users.{^#this.age };???? c.“$#”:投影(过滤)最后一个符合条件的元素,如:users.{$#this.age } 。2.“this”表示集合中的元素;3.投影(过滤)操作返回的是一个集合,可以使用索引取得集合中指定的元素,如:users.{?#this.age }[0]。实例:web.xml:?xml version=1.0 encoding=UTF-8? web-app version=2.5 xmlns=/xml/ns/javaee xmlns:xsi=/01/XMLSchema-instance?xsi:schemaLocation=/xml/ns/javaee /xml/ns/javaee/web-app_2_5.xsd? welcome-file-list welcome-filehello.jsp/welcome-file /welcome-file-list filter filter-namestru
原创力文档

文档评论(0)