title: Send array to Struts2 action with jQuery AJAX call
body: <p>So far, I've been able to send a simple string to a Struts2 action class, via an AJAX call. This time I need to do the same, but with a String array, and so I've changed my code like this:</p>
  
  <p><strong>1. AJAX call:</strong></p>
  
  <pre><code>var test = [1, 2, 3, 4, 5];
  
  $.ajax({
      method: "POST",
      url: "createexperiment4.action",
      data: { test : test },
      success:
          function()
          {
              window.location = "loadexperiments.action";
          }
  });
  </code></pre>
  
  <p><strong>2. CreateExperiment4Action.java:</strong></p>
  
  <pre><code>private String[] test;
  
  [...]
  
  public void setTest(String[] test)
  {
      this.test = test;
  }
  </code></pre>
  
  <p>However, the data isn't arriving to the action calss. Also, I keep getting this warning, which of course must be the key to my problem:</p>
  
  <blockquote>
    <p>WARNING: Parameter [test[]] didn't match acceptedPattern pattern!</p>
  </blockquote>
  
  <p>Maybe this is some kind of configuration issue?</p>