Write-only properties with Jackson

Viewed 15157

In my entity class, I'm trying to make a write-only field (gets ignored during serialization, but gets de-serialized normally).

@JsonProperty
@JsonSerialize(using=NullSerializer.class)
public String getPassword() {
    return password;
}

This almost gives me what I want: the JSON contains the "password" field, but the value is always null. How do I remove the field entirely?

2 Answers
Related