OGNL表达式循环List<String[]>类型数据的方法
2015-12-30 18:13
831 查看
不多说,上代码:
<span style="font-size:18px;color:#000099;"><s:iterator value="#application.userhistory" var="history">
<tr>
<td><%=++count %></td>
<td class="center"><s:property value="#history[0]"/></td>
<td class="center"><s:property value="#history[1]"/></td>
<td class="center"><s:property value="#history[2]"/><div class="raty"></div></td>
</tr>
</s:iterator></span>
其中,userhistory是存放在application域中的一个List<String[]>类型数据,循环显示方法为先遍历外层LIst,然后拿到String[]数组之后,再逐个取出,当然也可以遍历。此处由于数组长度为3,为了可读性,我直接输出的。看自己需求。
<span style="font-size:18px;color:#000099;"><s:iterator value="#application.userhistory" var="history">
<tr>
<td><%=++count %></td>
<td class="center"><s:property value="#history[0]"/></td>
<td class="center"><s:property value="#history[1]"/></td>
<td class="center"><s:property value="#history[2]"/><div class="raty"></div></td>
</tr>
</s:iterator></span>
其中,userhistory是存放在application域中的一个List<String[]>类型数据,循环显示方法为先遍历外层LIst,然后拿到String[]数组之后,再逐个取出,当然也可以遍历。此处由于数组长度为3,为了可读性,我直接输出的。看自己需求。
相关文章推荐
- Linux操作系统安装前备知识
- setValuesForKeysWithDictionary崩溃问题
- ScheduledExecutorService的使用
- Activity launchMode详解
- 模拟鼠标点击键盘按下
- php将文件夹打包成zip文件
- 使用DOM创建表格的完整流程
- 豌豆夹Redis解决方案Codis安装使用
- 关于jsp跳转简单总结
- 解读代码系统-具有定制列表项的用户界面
- 【JavaWeb Structs2学习】 路径介绍(在JSP页面a标签怎么写1)
- 处理other people游戏代码
- YUV Formats
- 使用Java导出Excel案例详解
- VC++6.0显示cannot compile the file***:no compile tool is associated with the file extension.
- 用例分析技术阅读笔记一
- javascript中的Array对象属性和方法整理
- 将MYSQL数据文件拷贝到使用LVM扩容的磁盘中
- sharding-ids-at-instagram
- android studio实现Jni(C/C++)单步调试方法步骤-标准配置教程