title: How to POST Json to a Play Framework Morphia controller
body: <p>I first tried using play 1.2.4 with morphia 1.2.6a to post json data to my controller. That always ended with a null pointer exception somewhere inside play, so I switched to play 1.2.3 and i got a bit further, but am still confused. The post call now succeeds but the data never seems to arrive.</p>
  
  <p>route</p>
  
  <pre><code>
  
      POST /mytest    mycontroller.myposttest
  
  </code></pre>
  
  <p>mycontroller.java</p>
  
  <pre><code>
  
      public static void myposttest(SampleObject item){
         Gson gs = new GsonBuilder().create();
         System.out.printf(gs.toJson(item));
         //NOTE: item is empty every time
      }
  
  </code></pre>
  
  <p>mytest.java</p>
  
  <pre><code>
  
      String jsonText = "{name=\"foo\"}"; 
      Response response = POST("/mytest/","application/json",jsonText);
      //NOTE: the post call succeeds but the jsonText data is not found on the other side
  
  </code></pre>
  
  <p>The examples I have read show this as just working, but I have been messing with this for a very long time and have not figured it out. How is this intended to work?</p>