Hi Pagullo,
Thank you very much for your response. I am now using DJN 2.1 and its working fine with Gson2.2.1.jar. But, now we need to obstruct some properties of the response object to be serealiazed. E.g.
Code:
@DirectMethod
public User getUser()
{
return new User();
}
User.java---
Code:
Class User
{
String userName="Jitendra";
String transient address = "Address123";
}
Now, from Gson guidelines, to obstruct "address" from being serialized to json, we have to use
Code:
GsonBuilder builder = new GsonBuilder().excludeFieldsWithModifiers(Modifier.TRANSIENT);
That means, we have to create GsonBuilder object with excludeFieldWithModifiers(). I have tried this code in the GsonBuilderConfiguratorForTesting.java in configure() method like
Code:
@Override
public void configure(GsonBuilder builder, GlobalConfiguration configuration) {
super.configure(builder, configuration);
builder.excludeFieldsWithModifiers(Modifier.TRANSIENT);
addCustomSerializationSupport(builder);
}
But, every things working fine and not any error is shown, but control does not come in callback function on clientside.
I believe, DJN is definately providing some way of configuration to implement transient attributes, but I am not finding it. Please suggest me how can i do this.
leve