8
有人可以幫我弄清楚需要添加什麼嗎?JSON:無法識別的字段「值」(<objectClass>),未標記爲可忽略
JSON:
{"value":{"keyword":"better","correct":"","page":0,"size":10,"cost":51,"total":1107}}
Object類
@JsonAutoDetect
@JsonSerialize(include = Inclusion.NON_NULL)
@JsonRootName(value = "value")
public class Response {
private int page;
private int size;
private int total;
private int cost;
private int result;
private String keyword;
private String correct;
不過它得到了「Servlet.service()進行的servlet appServlet拋出異常
org.codehaus.jackson.map .exc.UnrecognizedPropertyException: 無法識別的字段「value」(),未標記爲可忽略「
感謝您的答覆。順便說一下,我沒有使用ObjectMapper,而是使用RestTemplate。 – exception01 2012-02-21 03:38:20
更新爲使用RestTemplate – 2012-02-21 17:07:38