PDA

View Full Version : binding collections


rickla
Aug 18th, 2004, 10:33 AM
I am trying to figure out if I can bind collections into a table. I found some info online saying something like this would work:


<c:forEach var="addresses" items="${status.value}" varStatus="loopStatus">
<spring:bind path="command.addresses[${loopStatus.index}].startRange">
<input type="text" name="<c:out value="${status.expression}"/>" value="<c:out value="${status.value}"/>">
</spring:bind>



But it doesn't:

org.springframework.beans.FatalBeanException: No property [addresses[0]] in class [addresses]

This makes sense to me since I imagine it's just turning things into simple set commands.

So is this possible? My data type here is actually a Set (hibernate). I imaging if it returned a native array it would be fine. But I really wanted to just use a collection.

Possible at all?

rick