I have the following code and I would to achieve functionality that /getJson will return user object as json and /getJson2 will return user2 as Json object.
You must include all properties that you want to serialize. This includes the properties of the User class like this, for example:
@Action(value="/getJson", results = {
@Result(name="success", type="json",params = {
"includeProperties",
"user\.firstName, user\.lastName"})})
But, another form to get this work could be using regular expressions:
@Action(value="/getJson", results = {
@Result(name="success", type="json",params = {
"includeProperties",
"user\..*"})})
Regards.