title: How to handle lists with multiple select in thymeleaf?
body: <p>I have a <strong>multiple select</strong> something like this..</p>
  
  <pre><code>&lt;select multiple="multiple" th:field="*{names}"&gt;
   &lt;option value="abc"&gt;abc&lt;/option&gt;
   &lt;option value="def"&gt;def&lt;/option&gt;
   &lt;option value="ghi"&gt;ghi&lt;/option&gt;
   &lt;option value="jkl"&gt;jkl&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>where <code>names</code> is the name of the list which looks like this..</p>
  
  <pre><code>List&lt;String&gt; names=new ArrayList&lt;&gt;();
  </code></pre>
  
  <p>Now, I would like the user to select multiple names and then put into the <code>names</code> list.
  Consider that I have selected </p>
  
  <ol>
  <li><p>abc</p></li>
  <li><p>def</p></li>
  <li><p>ghi</p></li>
  </ol>
  
  <p>When I am submitting the form, I see that the data is sent like this..</p>
  
  <pre><code>names=abc&amp;names=def&amp;names=ghi
  </code></pre>
  
  <p>however, I want it to be like <code>names[0]=abc&amp;names[1]=def&amp;names[2]=ghi</code>.</p>
  
  <p><strong>P.S.</strong> I don't want to use Ajax form sending.</p>