This bean State :
public class State {
private boolean isSet;
@JsonProperty("isSet")
public boolean isSet() {
return isSet;
}
@JsonProperty("isSet")
public void setSet(boolean isSet) {
this.isSet = isSet;
}
}
is sent over the wire using the ajax success callback :
success : function(response) {
if(response.State.isSet){
alert('success called successfully)
}
}
Is the annotation @JsonProperty required here? What is the advantage of using it?
I think I can remove this annotation without causing any side effects.
Reading about this Jackson Annotations I don’t know when this is required to be used ?
Here’s a good example. I use it to rename the variable because the JSON is coming from a
.Netenvironment where properties start with an upper-case letter.This correctly parses to/from the JSON: