Struts2标签显示列表
把列表的对象在JSP中展现:
<ww:iterator value="peopleList" status="stat"> <s:property value="peopleList[#stat.index].id" /> <s:property value="peopleList[#stat.index].name" /> <s:property value="peopleList[#stat.index].age" /> <s:property value="peopleList[#stat.index].height"/> </ww:iterator>
<s:form action="update" method="post" > <s:iterator value="peopleList" status="stat"> <s:hidden name="peopleList[%{#stat.index}].id" value="%{peopleList[#stat.index].id}"/> <s:textfield label="Name" name="peopleList[%{#stat.index}].name" value="%{peopleList[#stat.index].name}"/> <s:textfield label="Age" name="peopleList[%{#stat.index}].age" value="%{peopleList[#stat.index].age}" /> <s:textfield label="Height" name="peopleList[%{#stat.index}].height" value="%{peopleList[#stat.index].height}"/> <br/> </s:iterator> <s:submit value="Update"/> </s:form>