tags:

views:

966

answers:

2

I need to render JSON data in my JSPs for some AJAX requests. I'd like to know what's the best way to do it in terms of easy to use and stability.

+1  A: 

Assuming you want to generate the JSON from one or more Java objects, the following is a fairly straightforward approach:

Don
A: 

I'm assuming you have checked out json.org already...

I recently switched from json-lib to XStream:

http://xstream.codehaus.org/

Definitely much easier. Just a few lines of code and you are done. Note, it started as an XML serializer, deserializer. It now supports JSON ouput.

Mike