我有一个类,其中有一个自定义反序列化器注释:
@JsonDeserialize(using = ConvertToNullDeserializer.class)
public void setObject(Integer pObj) {
this.pObj = pObj;
}
当此对象通过 ajax 发送到云端点时,我希望触发自定义脱轨器,但我只是得到:
{
"error" : {
"message" : "com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: Can not construct instance of java.lang.Integer from String value 'null': not a valid Integer value\n at [Source: N/A; line: -1, column: -1] (through reference chain:
"code" : 400,
"errors" : [ {
"domain" : "global",
"reason" : "badRequest",
"message" : "com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: Can not construct instance of java.lang.Integer from String value 'null': not a valid Integer value\n at [Source: N/A; line: -1, column: -1] (through reference chain:
} ]
}
}
谢谢!