Hi All,
I have exposed the services of my application as Jersey Rest and the
responses would be in the json format.
The Json format is accomplished by building a bean with the JAXB
Annotations.
The JAXB domain bean might have a collection (an array) or separate fields
such as string, int or other wrappers.
These wrappers are also annotated with the annotations.
Everything is working fine except, if the collection contains only one
element then the json - response is transmitted as
a object and not as a collection, and if it contains more than one it is
transmitted as collection.
The services are annotated with @Produces(MediaType.APPLICATION_JSON).
The same services are working fine if the return type is changed to string
instead of a domain object,
and responded with the string containing the serialized json value for the
domain object by using
any of the JSON Serializer. I'm using netsf json serializers.
Warm Regards,
Selvakumar N.