title: Passing array of String in HTML form and submit to Java Spring Controller?
body: <p>I'm having a hard time figuring out how to pass an array of values to a JHava spring controller method in <code>RequestParam</code>.</p>
  <p>My HTML form is below:</p>
  <pre><code>&lt;form method=&quot;post&quot;&gt;
      &lt;input type=&quot;text&quot; name=&quot;numbers[]&quot;&gt;
      &lt;input type=&quot;submit&quot;&gt;
  &lt;/form&gt;
  </code></pre>
  <p>and my Spring controller is as follows:</p>
  <pre><code>@RequestMapping(value=&quot;/send&quot;, method = RequestMethod.POST)
  public void sendMessage(String to[]) {
      for(String number: to) {
          System.out.println(number);
      }
  }
  </code></pre>
  <p>However when I run this, it shows an error:</p>
  <blockquote>
  <p>... is not applicable for the arguments</p>
  </blockquote>