摘要:
在实体对象上添加@JsonAutoDetect , 表明对该实体对象序列化成json串。@JsonAutoDetect public class User{ private int id; private String name; // 省略getter 和 setter }如果不想序列化某个属性,可以使用@JsonIgnoreProperties 进行标记@JsonAutoDetect @JsonIgnoreProperties (value = { "id" , "age" }) public class User{ private int id; 阅读全文