0

Possible Duplicate:
Pretty-Print JSON in Java?

I am using Java JSON library provided by google for google app engine. My JSON output somewhat looks like this:

{"data":[{"name":"John"},{"age":10}],"status":"success"}

Not human-readable and hard to debug. How can I turn the output into something like this?

{
   "data":[
      {
         "name":"John"
      },
      {
         "age":10
      }
   ],
   "status":"success"
}

Or some other form instead of "one-line output".

Community
  • 1
  • 1
ForeverNights
  • 631
  • 1
  • 7
  • 34
  • You can always use the JSONView plugin on Google Chrome https://chrome.google.com/webstore/detail/chklaanhfefbnpoihckbnefhakgolnmc which prettifies the output. – topless Sep 24 '12 at 18:40
  • - the thread that u mentioned using simple json to solve the problem. I am using gae provided lib which not able to solve this - i want to do it in the way that there is no need for end user to use plugin to view json output – ForeverNights Sep 25 '12 at 04:33
  • @SilverTsuki Most of the libraries mentioned in the link above by Trevor (e.g. Jackson, GSON) will work on GAE – husayt Sep 25 '12 at 09:57

0 Answers0