的status屬性

的status屬性
<s:iterator 中的status 使用方法
1:#status.odd 是否奇數行
2:#status.count 當前行數
3:#status.index 當前行的序號,從0開始『#status.count=#status.index+1』
4:#status.first 是否第一行
5:#status.last 是否最後一行
6:#status.modules(int) 當前行數取模

<s:iterator status="stuts">
status被設成stuts,在iterator的裏面就可以通過#stuts取得IteratorStatus的對象。
IteratorStatus類包含當前序號信息,如是否第一個或最後一個,是否爲奇數序號。這些信息在我們做
格式化的時候,顯得非常有用。

舉例:
<s:iterator value="userMap" id="users" status="st">
<tr>
<td><s:property value="#st.index+1"/></td>
<td><s:property value="value.userId"/></td>
<td><s:property value="value.userName"/></td>
<td><s:property value="value.userAge"/></td>
<td><s:property value="value.userSex"/></td>
<td><s:property value="value.userEmail"/></td>
</tr>
</s:iterator>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章