您的位置:首页 > 其它

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,为了可读性,我直接输出的。看自己需求。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: