PDA

View Full Version : return data from Java servlet in form of JSON encoded parameters in Javascript handle


kiruthika
07-24-2008, 11:20 AM
How to return data from Java servlet in form of JSON encoded parameters in Javascript handler function call?

The same is implemented in php as the following

echo "sT.handleAjaxResponse(";
echo json_encode($response);
echo ");";

How to do the same in Java servlet?

Thanks.

ess
07-28-2008, 05:16 PM
Download JSON library from http://www.json.org/java/

There are a number of examples on that website as well ;)

Cheers
~E