我在Glassfish 3.1.2上使用Jersey 1.18,我试图将属性设为只读。我已经使用了MOxy @XmlReadOnly,但它被封送了。
@XmlReadOnly
private String password;
有什么可以做的吗?
谢谢!
答案 0 :(得分:0)
如documentation of @XmlReadonly
所述,添加@XmlElement
也解决了我的问题:
@XmlElement
@XmlReadOnly
private String password;