读书人

Struts2标签展示列表

发布时间: 2012-11-14 10:12:18 作者: rapoo

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> 




1 楼 liuxinsudi 2008-03-18 能否把你的整个项目贴出来呢?要不然让我拜读一下:liuxinsudi@163.com

读书人网 >软件架构设计

热点推荐