Is there "native" support for JSON in JDK6 Script Engine?
Posted
by Ayman
on Stack Overflow
See other posts from Stack Overflow
or by Ayman
Published on 2010-05-03T10:11:46Z
Indexed on
2010/05/03
10:18 UTC
Read the original article
Hit count: 406
I'm using JDK6the standard Scripting. I need to store and retrieve some JavaScript Objects that also contain Java Objects to JSON. I loaded the json2.js into the ScriptENgine and can use it fine without issue if the objects are all created in the Scrip Engine. The moment I try to use my own Java classes, I get some errors like "object does not support toJSON" errors.
I did not find much about JSON in Java Scripting / Rhino context.
Am I doing something totally wrong? What's the best way of achieving the requirement?
© Stack Overflow or respective owner