title: java how to get json from a request?
body: <p>I'm posting a json request to server. I can see the http post is done correctly in firebug. (I'm sure the json format is valid)</p>
  
  <p>eg.  {datas:[{"a":1, "b":2},{"a":5, "b":6}]}</p>
  
  <p>my question is, how do I recover this data in the server side? I read people saying to use <code>request.getInputStream</code> but can't figure how to convert it into string or parse with GSON.</p>
  
  <p>another question: is there a limite of size of a json string I can post?</p>
  
  <p>(Struts 2)</p>
  
  <pre><code>dojo.xhrPost({
                  url: "sub/sub/theAction",
                  postData: dojo.toJson(json),
                  handleAs:'json',
                  headers: { "Content-Type": "application/json; charset=utf-8"},          
                  load: function(data) {      
                      alert("done");          
  
                          }
                  }                       
              });
  </code></pre>
  
  <p>thanks in advance</p>