日期:2014-05-18 浏览次数:20738 次
public class testAction extends ActionSupport{
public List<User> testList= new ArrayList<User>();
public String execute(){
for(int i = 0;i<10;i++){
testList.add(new User());
}
return "SUCCESS";
}
public List<User> getTestList() {
return testList;
}
public void setTestList(List<User> testList) {
this.testList = testList;
}
}
<table class="Checkbox_table_2">
<tr>
<td >Name</td>
<td>Password</td>
</tr>
<s:iterator value = "testList" id = "info">
<tr>
<td><s:textfield name = "info.login"></s:textfield ></td>
<td><s:textfield name = "info.password"></s:textfield ></td>
</tr>
</s:iterator>
</table>
<s:iterator value = "testList" status="st">
<tr>
<td><s:textfield name = "testList[#st.index].name"></s:textfield></td>
<td><s:textfield name = "testList[#st.index].password"></s:textfield ></td>
</tr>
</s:iterator>