title: Wicket http post, get raw data from servletrequest?
body: <p>I try do POST some data to a Wicket WebPage. This works fine if the data is in a form. However, I want to post the data with jQuery's ajax-post. I am unable to get this data in my Page-constructor.  </p>
  
  <p>This is my jquery command:</p>
  
  <pre><code>$.ajax({
                      type: "post",
                      cache: false,
                      url: "http://localhost:8888/testjson",
                      data: JSON.stringify({"aap":"noot"),
  
                      contentType: 'application/json',
                      success: function(ydata){alert("aap");},
                      failure: function(errMsg) {alert(errMsg);},
                          contentType: false,
                      dataType: "json"
                  });
  </code></pre>
  
  <p>The /testjson is a mounted WebPage.</p>
  
  <pre><code>public TestJsonApiPage( PageParameters pp )
  {
      try
      {
          byte[] data = IOUtils.toByteArray( ( (ServletWebRequest) TestJsonApiPage.this.getRequest() ).getContainerRequest().getInputStream() );
      }
      catch ( IOException e )
      {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  </code></pre>
  
  <p>This is the constructor. What I see happening is that the inputstream is empty. However, when debugging, I see the raw data that I posted in <code>HttpServletRequest</code> in the <code>newWebRequest</code> in my <code>WicketApplication</code></p>
  
  <p><strong>tl;dr</strong> How to get the raw post data in Wicket Page?</p>