This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Services and the fly likes returning json from GlassFish Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "returning json from GlassFish" Watch "returning json from GlassFish" New topic
Author

returning json from GlassFish

Tim Sparg
Ranch Hand

Joined: Dec 29, 2006
Posts: 40
Hi all

I need some help understanding json, and how it is returned.

I've got a simple user object (usercode,userFirstname,userSurname,pwChanged).
Which is represented like so in in json



This I completely understand. However when I get a List of the user objects from Glassfish, I get the following



When I try and pass this through something like Google GSON I get an error until I change the json string to look like the following



Note the removal of the {"user"[]} that surrounded the first list.

Am i misunderstanding something here?


There is no insanity so devastating in man's life as utter sanity
 
GeeCON Prague 2014
 
subject: returning json from GlassFish