假设我有两个类,如下所示
Class Student{
private int id;
private String name;
private String address;
}
Class University{
private String id;
private String name;
private String address;
private ArrayList<Student> students;
//Getters and Setter methods
}
现在我如何绑定大学 bean 以便我可以在控制器中捕获学生列表的数据?像这样的东西
<form:form action ="controller.htm">
//... input tags binded with university id, name and address
<form:input path = "students[0].id">
<form:input path = "students[0].name">
<form:input path = "students[0].address">
<form:input path = "students[1].id">
<form:input path = "students[1].name">
<form:input path = "students[1].address">
//... and so on
</form:form>