users@glassfish.java.net

Gizzly Websocket how to use google json sending and receiving both from

From: <forums_at_java.net>
Date: Tue, 15 Jan 2013 04:06:19 -0600 (CST)

I am trying to send send data using json from client to server and vice
versa. In my socket when I receive the message I do not receive the json
data. Client: var member ={ "firstName":"Ray", "lastName":"Villalobos",
"joined":2012 }; ws = new WebSocket("ws://localhost:8080/echo"); ws.onopen =
function(evt) { log("socket opened"); ws.send ('Data', member);}; Server:
@Override public void onMessage(String text) { System.out.println("onMessage
" + text); Data data = new Gson().fromJson(text, Data.class);
System.out.println("onMessage " + data); } Does any body have any examples of
how I can use json and websockets Cheers Charlie

--
[Message sent by forum member 'charliesimms']
View Post: http://forums.java.net/node/893873