这豆'州':
public class State {
private boolean isSet;
@JsonProperty("isSet")
public boolean isSet() {
return isSet;
}
@JsonProperty("isSet")
public void setSet(boolean isSet) {
this.isSet = isSet;
}
}
Run Code Online (Sandbox Code Playgroud)
使用ajax'success'回调通过线路发送:
success : function(response) {
if(response.State.isSet){
alert('success called successfully)
}
Run Code Online (Sandbox Code Playgroud)
这里需要注释@JsonProperty吗?使用它有什么好处?我想我可以删除这个注释而不会产生任何副作用.
在https://github.com/FasterXML/jackson-annotations/wiki/Jackson-Annotations上阅读这个注释我不知道什么时候需要使用它?