<form action="param/saveAccount" method="post">
ID:<input type="text" name="id"/><br/>
用户名:<input type="text" name="userName"/><br/>
金额:<input type="text" name="money"/><br/>
<%--把数据封装到Account类中,类中有list和map类型数据--%>
list:<br/>
姓名:<input type="text" name="userList[0].uname"/><br/>
年龄:<input type="text" name="userList[0].age"/><br/>
map:<br/>
姓名:<input type="text" name="userMap['one'].uname"/><br/>
年龄:<input type="text" name="userMap['one'].age"/><br/>
<input type="submit" value="提交"/><br/>
</form>
public class Account implements Serializable {
private Integer id;
private String userName;
private Float money;
private List<User> userList;
private Map<String,User> userMap;
}
public class User implements Serializable {
private String uname;
private Integer age;
}