I am doing a project using Struts2 and I have a problem assigning a set collection.
Here's my Action (I eliminated the irrelevant part)
public class TeamAction extends BaseAction implements ModelDriven<Team>
{
Team team=new Team();
}
Here's my model Team
(I eliminated the irrelevant part)
private TeamId id;
private Set students = new HashSet(0);
Here's my JSP part
<input type="text" name=team.student[0].id />
Now the problem is I can't insert the right value into this Set
collection in by ModelDriven
, it will throw a exception. Could you please tell me what to write in JSP file, so I can insert a value to Set
collection in my model?