这个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;
}
}
使用ajax的'success'回调函数将其发送到网络:
success : function(response) {
if(response.State.isSet){
alert('success called successfully)
}
这里需要使用 @JsonProperty 注解吗?使用它有什么优势?我认为我可以删除这个注解而不会产生任何副作用。
在 https://github.com/FasterXML/jackson-annotations/wiki/Jackson-Annotations 上阅读有关此注释的信息,但我不知道何时需要使用它。