title: Grails generic JSON handling of request and response
body: <p>i asked myself if there is a generic approach where i can parse requests in a generic way or add fields to a JSON response with every response sent.</p>
  
  <p>I would like to receive and parse something like:</p>
  
  <pre><code>{
      transactionId:456, // every response contains this
      statuscode:1,
      content:{ // only content is changing
            {
                class:"org.something.test",
                id:123,
                name:"test",
                referenceIdToOtherClass:345
            }
      }
  
  }
  </code></pre>
  
  <p>The contents of "content" should be converted e.g. to an instance of the given class.</p>
  
  <p>The response should work also in such generic way (changing content, some fields always).</p>
  
  <p>Would you reccomend a JSON marshaller, a Filter or something different?</p>
  
  <p>Thank you</p>