title: handle form post with a array of items in spring MVC
body: <p>I'm trying to send some data from the client side to the server, and have it processed into a file download.
  I'm using a simple HTML form because I want to initialize a file download (and not AJAX).
  one of the form fields is an array of items. (the other two are name and description strings).
  I'm serializing this field to a string (JSON.stringify) before submitting the form.</p>
  
  <p>on the server side I tried a million techniques (@ModelAttribute vs. @RequestBody, different jackson mapping bean configurations) to either convert this to a single type or to three separate types (String + String + List/Array).</p>
  
  <p>the examples I found were only for AJAX...
  can anyone supply a working example or a description of one?</p>
  
  <p>=======</p>
  
  <p>Update:
  I've implemented a workaround by JSON.stringify-ing the collection and passing it in one of the inputs,
  and on the server side I have:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST, value = "exportSectionsToExcel")
    public HttpEntity&lt;byte[]&gt; createExcelWorkBook(@ModelAttribute ExportSectionsListForm exportSectionsListForm) {
  Section[] sectionObjects = gson.fromJson(exportSectionsListForm.getSections(), Section[].class);
  ...
  </code></pre>
  
  <p>with ExportSectionsListForm object containing strings only:</p>
  
  <pre><code>public class ExportSectionsListForm {
  private String name;
  private String url;
  private String rssUrl;
  private String sections;
  ...
  (omitting ctor, getters and setters)
  </code></pre>
  
  <p>additionally, I found this promising link:
  <a href="http://viralpatel.net/blogs/spring-mvc-multi-row-submit-java-list/" rel="nofollow">http://viralpatel.net/blogs/spring-mvc-multi-row-submit-java-list/</a>
  but didn't try it - seems like I'll need to dynamically generate input elements for this to work, but it might actually be the right solution. has anyone tried this?</p>