There is now as of Spring 2.5.0 a very simple way to handle collections of checkboxes and radiobuttons.
in Spring 2.0.7 you can't do
<c:forEach var="interest" items="${interests}">
<frm:checkbox path="interests" value="${interest}" />
<c: out value="${interest.name}" />
</c:forEach>
where items="${interests}" is the complete Set of things people may be interested in and path="interests" is the Set of things a given person is interested in. The reason, I think, has to do with this post:
http://opensource.atlassian.com/proj...rowse/SPR-3704.
Thankfully this has been fixed in Spring 2.5.0 and in addition there is a new shorthand method (mentioned in this post:
http://opensource.atlassian.com/proj...rowse/SPR-3882:
<frm:checkboxes path="interests" items="${interests}" itemLabel="name"/>
Things to note:
1. Make sure your object has a proper equals() method or it won't work.
This is one of those issues I'm glad I spent time trying to figure out because none of the alternatives were very good.
http://blog.jsks.us/index.php/2007/1...his-a-victory/