score:0

I'm not 100% sure what's going wrong here, but there are a few things I am concerned about.

Firstly, your JSON is not valid. x, y and name should be quoted:

{ "x": 1406199133117, "y": 5, "name": "Test" }

I am concerned about:

String json = new Gson().toJson("{x:1406199133117,y:5,name:'Test'}");

Why not simply write the string ?

resp.getWriter().write("{\"x\":1406199133117,\"y\":5,\"name\":'Test'}");

Lastly, I would return the entire array, including the [] braces rather than adding them in the client.

Hopefully some of that helps :)


Related Query

More Query from same tag