문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top