title: How to send multiple values for the same field from JSP to Controller in Spring MVC (Eclipse)?
body: <p>I am pretty sure the answer to this question available somewhere and I am probably asking this wrong. Imagine I have a text box to store previous work experience of someone on a form. The user may have one or more previous work experience. So, if they want to enter more than one work experience, they'll just clone the text box to enter a new data (For the same field). The user can clone it as many times as they want to. My question is, how can I send these data (Random number of unique inputs for the same field) from JSP to my Controller?
  I was trying to follow this example, </p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div id="clonedInput1" class="clonedInput"&gt;
  &lt;div&gt;
      &lt;label for="txtCategory" class=""&gt;Learning category &lt;span class="requiredField"&gt;*&lt;/span&gt;&lt;/label&gt;
      &lt;select class="" name="txtCategory[]" id="category1"&gt;
          &lt;option value=""&gt;Please select&lt;/option&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;label for="txtSubCategory" class=""&gt;Sub-category &lt;span class="requiredField"&gt;*&lt;/span&gt;&lt;/label&gt;
      &lt;select class="" name="txtSubCategory[]" id="subcategory1"&gt;
          &lt;option value=""&gt;Please select category&lt;/option&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;div&gt;
      &lt;label for="txtSubSubCategory"&gt;Sub-sub-category &lt;span class="requiredField"&gt;*&lt;/span&gt;&lt;/label&gt;
      &lt;select name="txtSubSubCategory[]" id="subsubcategory1"&gt;
          &lt;option value=""&gt;Please select sub-category&lt;/option&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  &lt;div class="actions"&gt;
      &lt;button class="clone"&gt;Clone&lt;/button&gt; 
      &lt;button class="remove"&gt;Remove&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>
  <strong>JAvascript - JQuery</strong></p>
  
  <pre><code>var regex = /^(.+?)(\d+)$/i;
  var cloneIndex = $(".clonedInput").length;
  
  function clone(){
      $(this).parents(".clonedInput").clone()
          .appendTo("body")
          .attr("id", "clonedInput" +  cloneIndex)
          .find("*")
          .each(function() {
              var id = this.id || "";
              var match = id.match(regex) || [];
              if (match.length == 3) {
                  this.id = match[1] + (cloneIndex);
              }
          })
          .on('click', 'button.clone', clone)
          .on('click', 'button.remove', remove);
      cloneIndex++;
  }
  function remove(){
      $(this).parents(".clonedInput").remove();
  }
  $("button.clone").on("click", clone);
  
  $("button.remove").on("click", remove);
  </code></pre>
  
  <p><a href="http://jsfiddle.net/mjaric/tfFLt/" rel="nofollow noreferrer">Example</a>. I just replaced the dropdown box with text box. What I want is, the user can enter data in these fields however many times they want, and at the end they'll press a button submit and it will send the data to my controller. I am very new to using Spring MVC, JSP, Servlet and Controllers. Any kind of help or direction would be great. I know how to create the form in HTML with cloning feature, but I do not know how to send the data to the controller at once.</p>