Javascript and Java Object Conversion

A. Sundararajan sundararajan.athijegannathan at oracle.com
Wed Jan 1 23:58:32 PST 2014


Missed answering this post below.. (deleted original email accidentally!).

No, Java objects can not be serialized to JSON strings. Java objects in 
general are graphs and not trees as required by JSON.

There are third-party Java libraries that serialize Java objects as JSON 
strings.

-Sundar

------

Hi, im trying Nashorn. I've seen that, Java Arrays, Lists convertable to
Javascript Array.

But, in Java Custom object type, for example Book, it needs to be converted
to JSON string and needs to creating a Javascript object from this
stringified Json.

I think, there must be an easy way, to binding between Javascript and Java
Object.

-- 
Rahman USTA
0-(531)-922-28-05
www.kodcu.com




More information about the nashorn-dev mailing list