<p>I'm trying to bind one of my model objects to the fields of a form, using Spring-MVC. Everything works fine, except that one of the attributes of the model object is an unordered collection. Doing something like</p>

<pre><code>    &lt;c:forEach items="${m.items}" var="i" varStatus="itemsRow"&gt;
      &lt;form:input path="items[${itemsRow.index}]"/&gt;
    &lt;/c:forEach&gt;
    &lt;form:errors path="items" /&gt;
</code></pre>

<p>would work fine for a List-type property, but for a Set throws an error when, upon submit, it tries to bind input field content to object attributes.</p>

<p>Is there something in Spring that works out of the box with Sets?</p>

I think it has to be an ordered collection.  For example,there's
a chart
in the Spring reference that talks about how to reference properties.  It says:
account[2]    Indicates the third element
  of the indexed property account.
  Indexed properties can be of type
  array, list or other
naturally ordered
collection (emphasis theirs)
Perhaps one approach would be to add a getter to your object that, rather than returning your Set, returns Set.toArray().  Then your items attribute would reference the array.  Of course, you can't depend on the ordering.