Domanda

I have a POJO class like this:

public class EsigObjectWithDisplayName {

    private String objectCode;
    private String objectDisplayName;

    public EsigObjectWithDisplayName(Locale loc, String objectCode, String objectLocaleCode) {
        this.objectCode = objectCode;
        this.objectDisplayName = Res.s(loc, objectLocaleCode);
    }
    public EsigObjectWithDisplayName(){}

    public String getObjectCode() {
        return objectCode;
    }

    public String getObjectDisplayName() {
        return objectDisplayName;
    }
}

and a AS class like this:

package ...
{
[Bindable]
[RemoteClass(alias="...EsigObjectWithDisplayName")]
public class EsigObjectWithDisplayName
{
    public var objectCode:String;
    public var objectDisplayName:String;


    public function toString():String {
       return objectDisplayName;
    }
}
}

The only way this gets populated is when i modify POJO fields' access to public.
I was under impression that defining public POJO accessors is all that BlazeDS needs for deserialization. What am missing here?

È stato utile?

Soluzione

You need both a getter and a setter, see this link:

For Java objects that BlazeDS does not handle implicitly, values found in public bean properties with get/set methods and public variables are sent to the client as properties on an Object.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top