title: How to send multiple values of checkbox to back-end in param=value1%2Cvalue2 format?
body: <p>I have a checkboxlist in my form as following, which I do not know whats the best way to receive its selected options in back-end.</p>
  
  <pre><code>&lt;s:form id="search" name="search" method="GET" action="search"&gt;
      &lt;s:checkboxlist name="mySearch.age" label="Age" list="@com.example.Lists@AGE"/&gt;
      &lt;s:checkboxlist name="mySearch.gender" label="Gender" list="@com.example.Lists@GENDER"/&gt;
      &lt;s:select name="mySearch.education"  label="Education" list="@com.example.Lists@EDUCATION"/&gt;
      &lt;s:select name="mySearch.country" label="Country" list="@com.example.Lists@COUNTRY"/&gt;
      &lt;s:textfield id="mySearch.terms" name="mySearch.terms" label="Terms (Separate by comma)"/&gt;
    &lt;s:submit value="Submit"/&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p>I am not sure what the type of age should be and how to catch it in back-end.</p>
  
  <p>I need them to be as following or any other format to be easy to search based on them</p>
  
  <pre><code>   age=20%2C30 or age=20,30
  </code></pre>
  
  <p><strong>1)</strong> At the moment it is like following </p>
  
  <pre><code>  private List&lt;Integer&gt; age; 
  </code></pre>
  
  <p>and the values will be as follwoing in the url, </p>
  
  <pre><code>   mySearch.age=20&amp;mySearch.age=30
  </code></pre>
  
  <p><strong>2)</strong> I used javascript function and simple html (same as <a href="http://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_checkbox" rel="nofollow">this</a>) to send the values as well using following code but it sends them as age=20&amp;age=30 </p>
  
  <pre><code>     $('#search').serialize()
  </code></pre>
  
  <p><strong>3)</strong> I also used the following code to send them as age=2,3 which is fine but I am wondering how to send the values of other fields of the form along with these values? </p>
  
  <pre><code>var formValues = $('#search').serialize();
      var obj={};
      obj.ages = $('input[name=age]:checked').map(function(){
          return this.value;
      }).get();
      alert(obj.ages);
  </code></pre>