again, i removed everything, left only this on page:
HTML Code:
<body>
<form:form method="post">
<form:checkboxes path="selectedMembers" items="${friends}"/>
<input type="submit" value="save" />
</form:form>
</body>
for controller:
Code:
<property name="commandClass">
<value>com.thell.form.InviteToEventForm</value>
</property>
command class:
Code:
public class InviteToEventForm {
private String emails;
private Set<Friend> selectedMembers;
public String getEmails() {
return emails;
}
public void setEmails(String emails) {
this.emails = emails;
}
public Set<Friend> getSelectedMembers() {
return selectedMembers;
}
public void setSelectedMembers(Set<Friend> selectedMembers) {
this.selectedMembers = selectedMembers;
}
}
It should work, but it does not work. When I select any checkbox (in set I have only one, but it should not matter).
So when I select element, submit does not work - I am forwarded back to the same page through :
Code:
@Override
protected Object formBackingObject(HttpServletRequest request)...
and when element from checkbox is not selected, submit method works!!!
Code:
@Override
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception {
What is the problem?