how to initialize and add data into list in the jsp view?
my model class is like this:
Manager.java
Code:
class Manager {
int mgrId;
String name;
Set<Emp> employees;
// getter-setter methods
}
Emp.java
Code:
class Emp {
int empId;
String name;
String department;
// getter-setter methods
}
my jsp page is like this:
create_manager.jsp
Code:
<form:form modelAttribute="manager">
Manager Name: <form:input path="${manager.name}" maxlength="32" />
<table>
<tr>
<th>Emp Name</th>
<th>Salary</th>
<th>Department</th>
<th> </th>
</tr>
<tr>
<td><form:input path="${what shall i write here?}" /></input></td>
<td><form:input path="${what shall i write here?}" /></input></td>
<td><form:input path="${what shall i write here?}" /></input></td>
<td><input type="button" value="Add New Employee" />
</tr>
</table>
</form:form>
how to initialize Set<Emp> employees object in the above jsp view? what shall be the bindings. please help.