title: How to post an array of JSON objects to a Struts2 action using jQuery?
body: <p>Using Struts2.
  In my Action I have a <code>List&lt;Person&gt; persons;</code> </p>
  
  <p>In javascript, I have this function:</p>
  
  <pre><code>function mytestfunction() {
      var url = "MyAction_mytestfunction.action";
      var params = {};
      var arr = [];
      var p1 = { "firstname" : "John", "lastname" : "Doe"};
      var p2 = { "firstname" : "Rob", "lastname" : "Smith"};
      arr.push(p1); arr.push(p2);
      params["persons"] = arr;
      $.post(url, params, function(data) {
          console.log("done");
      });
  }
  </code></pre>
  
  <p>Problem is, the post() never reaches the action. There are no errors in the logs, nothing.</p>
  
  <p>This all changes if instead of posting objects I post primitives. So when I have a <code>List&lt;Integer&gt; nums</code> in the Action and <code>params["nums"] = [1,2,3];</code> in javascript, everything is posted fine.</p>
  
  <p>So, is there a way to post JSON objects to a Struts2 action via javascript/jquery?</p>
  
  <p>I should mention that I'm using the struts-jquery plugin, not dojo.</p>