uCosminexus Application Server, Web Service Development Guide

[Contents][Glossary][Index][Back][Next]

18.1.2 Mapping on a client

Specify true or false for the com.sun.jersey.api.json.POJOMappingFeature feature of the common definition file (cjrconf.properties) or add the com.sun.jersey.api.json.POJOMappingFeature feature to the property map of the client object.

The following example shows how to add the com.sun.jersey.api.json.POJOMappingFeature feature:

// Generate a ClientConfig object
ClientConfig cc = new DefaultClientConfig();
// Add features to the ClientConfig object
// to enable the JSON POJO mapping cc.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, true);
// Specify the generated ClientConfig object
// to generate a Client object
Client client = Client.create(cc);

In the above example, a Client object is generated by specifying ClientConfig to which JSONConfiguration.FEATURE_POJO_MAPPING is already added.

If a value is specified in the common definition file and the Client object, the value specified in the Client object is given preference.