struts2標籤之iterator遍歷集合

2022-08-19 19:15:12 字數 2632 閱讀 6764

1、list> list 遍歷

<

table

class

="table"

>

<

tr>

<

th>column

th>

<

th>key

th>

<

th>value

th>

<

th>column

th>

<

th>key

th>

<

th>value

th>

<

th>column

th>

<

th>key

th>

<

th>value

th>

tr>

<

s:iterator

value

="list"

id="map"

>

<

tr>

<

s:iterator

value

="map"

id="column"

>

<

td align

="center"

><

s:property

value

="#column"

/>

td>

<

td align

="center"

><

s:property

value

="key"

/>

td>

<

td align

="center"

><

s:property

value

="value"

/>

td>

s:iterator

>

tr>

s:iterator

>

table

>

<

table

class

="table"

>

<

tr>

<

th>名稱(value)

th>

<

th>出生時間(value)

th>

<

th>技能(value)

th>

tr>

<

s:iterator

value

="list"

id="map"

>

<

tr>

<

td align

="center"

><

s:property

value

="name"

/>

td>

<

td align

="center"

><

s:property

value

="birth"

/>

td>

<

td align

="center"

><

s:property

value

="skill"

/>

td>

tr>

s:iterator

>

table

>

效果:column

keyvalue

column

keyvalue

column

keyvalue

birth=2000

birth

2000

skill=噴火

skill

噴火name=大娃

name

大娃birth=2001

birth

2001

skill=隱身

skill

隱身name=二娃

name

二娃birth=2002

birth

2002

skill=變大

skill

變大name=三娃

name

三娃birth=2003

birth

2003

skill=大力士

skill

大力士name=四娃

name

四娃birth=2004

birth

2004

skill=飛天

skill

飛天name=五娃

name

五娃名稱(value)

出生時間(value)

技能(value)

大娃2000

噴火二娃

2001

隱身三娃

2002

變大四娃

2003

大力士五娃

2004

飛天2、得到遍歷時的序號

done!

struts2之表單標籤

概述表單標籤將在 html 文件裡被呈現為乙個表單元素 使用表單標籤的優點 表單回顯 對頁面進行布局和排版 標籤的屬性可以被賦值為乙個靜態的值或乙個 ognl 表示式.如果在賦值時使用了乙個 ognl 表示式並把它用 括起來,這個表示式將會被求值.表單標籤的共同屬性 該屬性只在沒有使用 主題時才可以...

struts2標籤簡介

用過struts1.x的人都知道,標籤庫有html bean logic tiles,而struts2.0裡的標籤卻沒有分類,只用在jsp標頭檔案加上 taglib prefix s uri struts tags 就能使用struts2.0的標籤庫 下面就介紹下每個標籤的用法 有錯請指正 a 超連...

struts2標籤解釋

a 超連結,類似於html裡的 雙下拉框 e 這3個標籤一起使用,表示條件判斷 f 顯示檔案錯誤資訊 檔案上傳 獲取相應form的值 g 和標籤一起使用 h 在裡使用,表示標頭檔案結束 隱藏值 i 載入資源包到值堆疊 包含乙個輸出,servlet或jsp頁面 獲取form的乙個輸入 用於遍歷集合 l...