title: Bind a set in a spring form
body: <p>I am trying to bind a spring form with a set in the command object.</p>
  
  <p>In my command class <strong>AInstance</strong> I defined set as </p>
  
  <pre><code>private Set&lt;BParameter&gt; bParameters = new HashSet&lt;BParameter&gt;();
  </code></pre>
  
  <p>In jsp I bind it as</p>
  
  <pre><code>&lt;form:input path="bParameters " /&gt;
  &lt;form:input path="bParameters " /&gt;
  </code></pre>
  
  <p>As its a Java <strong>Set</strong> so there may be many fields. When I submit this form I tried to get <strong>Set</strong> as:</p>
  
  <pre><code>Set&lt;BParameter&gt; bParameters = aInstance.getBParameters();
  </code></pre>
  
  <p>I got <strong>Set</strong> with a 0 size.</p>
  
  <p>I also tried to bind as </p>
  
  <pre><code>&lt;form:input path="bParameters[${itemsRow.index}].bParmvalues[0].parmValue" /&gt;
  </code></pre>
  
  <p>but got exception </p>
  
  <pre><code>Invalid property 'bParameters[0]' of bean class
  </code></pre>
  
  <p>What is the problem with my binding?</p>