Exactly how to do this depends on the version of Jackson that you're using. This changed around version 1.9, before that, you could do this by adding
@JsonIgnore to the getter.
Which you've tried:
Add @JsonIgnore on the getter method only
Do this, and also add a specific
@JsonProperty annotation for your JSON "password" field name to the setter method for the password on your object.
More recent versions of Jackson have added
WRITE_ONLY annotation arguments for
JsonProperty. So you could also do something like:
@JsonProperty(access = Access.WRITE_ONLY) private String password;
Docs can be found here.
~ Answered on 2012-09-20 01:53:47