According to @ tomasz-nurkiewicz comment, I have to use annotation @XmlTransient. But as stated in the documentation
By default, if @XmlAccessorType is not in the class, and none of its superclasses are annotated with @XmlAccessorType, the following default value for the class is assumed:
@XmlAccessorType (XmlAccessType.PUBLIC_MEMBER)
XmlAccessType.PUBLIC_MEMBER , :
/ XML, XmlTransient. getter/setter, , , XML , JAXB.
@XmlTransient Tomasz Nurkiewicz. :
1) :
private String password;
@XmlTransient
public String getPassword() {
return password;
}
2) @XmlAccessorType :
@XmlAccessorType(XmlAccessType.FIELD)
public User {
@XmlTransient
private String password;
}
: http://old.nabble.com/@XmlTransient-ignored-td7406659.html