Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSON in Java

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which library would you recommend for JSON in Java ?
There are five listed at json.org
* org.json.
* Json-lib.
* JSON Tools.
* org.json.simple.
* Stringtree.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried Json-lib and it's fine.
If you still have any recommendations to work with JSON in Java, please tell
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I ask why you need a library to work with JSON? All it is a fancy string that is easy to build?

Eric
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's right, I could do without a library. I have stored some information (the double combos of Ajax In Action) in a bean, so I wanted to converted it without worrying about colons, brackets and so on. I was reading in an other book yesterday about JSON libraries for server side, so I wanted to give it a shot Do you mean that you never use such libraries ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eric Pascarello:
Can I ask why you need a library to work with JSON? All it is a fancy string that is easy to build?


I see a great benefit to such libraries.

Structures can get pretty complicated and I don't think it's much different than building up HTML or XML in string buffers. It's much better to build up a Java strucxture (be it a DOM or otherwise) and then serialize it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic