Sending JavaScriptObject back to server

1 view
Skip to first unread message

DaGreat

unread,
Nov 6, 2009, 1:25:39 PM11/6/09
to Google Web Toolkit
Hi,

I'm trying to send a JavaScriptObject back to the server. Is this
possible to do? I first tried to send the String representation of my
JSON Object to the server just to realize the JSONParser was usable on
the client (browser) side only.

Any help is welcome here,

Thanks.

rjcarr

unread,
Nov 8, 2009, 10:49:00 PM11/8/09
to Google Web Toolkit
Any object that is serializable should be transferrable over the wire
to the server. I just looked and it doesn't seem like
JavaScriptObject is serializable, so you are probably out of luck.
I'm reasonably sure there are (maybe third-party) GWT libraries for
using JSON communication.

As for your second point, I would assume this to work on the server,
but I haven't tried it. The only reason it wouldn't is if it used
JSNI, which is certainly possible ... you'd need to check the source
code to verify.

Hope this helps.

Thomas Broyer

unread,
Nov 9, 2009, 4:42:40 AM11/9/09
to Google Web Toolkit

On Nov 6, 7:25 pm, DaGreat <chika...@gmail.com> wrote:
> Hi,
>
>    I'm trying to send a JavaScriptObject back to the server. Is this
> possible to do? I first tried to send the String representation of my
> JSON Object to the server just to realize the JSONParser was usable on
> the client (browser) side only.

There are several JSON parsers in Java that you can use on the server
side; see http://www.json.org
Reply all
Reply to author
Forward
0 new messages