users@jersey.java.net

Re: [Jersey] Query on jersey

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Thu, 28 Oct 2010 13:06:10 +0200

Hi,

You need to use Jackson, a library for JSON and POJOs. See:

   https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html
#d0e1959

Paul.

On Oct 28, 2010, at 9:24 AM, S, Shamsudeen wrote:

> Hi,
>
> I am implementing jersey restful web service to get application/json
> mime type from the java bean classes. Given below is the resource
> class code
> @GET
> @Produces({"application/json"})
> public synchronized Flights getFlightList() {
> return myFlights;
> }
> Here if the return object (Flight) converts to json object only when
> the Flight encoding with jaxb. For normal POJO classes it not
> returning anything instead of Http error”500” is coming.
>
> Can you please tell me is it possible to send normal java bean
> object as json format? If yes what are the procedures to follow to
> achieve the same?
> Thanks and regards,
>
> Shamsudeen
> (cub)4B - 3rd - 3240
> (ext) 8040261
>
> This message contains information that may be privileged or
> confidential and is the property of the Capgemini Group. It is
> intended only for the person to whom it is addressed. If you are not
> the intended recipient, you are not authorized to read, print,
> retain, copy, disseminate, distribute, or use this message or any
> part thereof. If you receive this message in error, please notify
> the sender immediately and delete all copies of this message.
>