@JsonIgnore一般用于类的属性上,作用和上面的@JsonIgnoreProperties 一样。** public class User { private String userName; private String fullName; private String password; //生成json时将userRoles属性过滤 @JsonIgnore private List<UserRole> userRoles = new ArrayList<>();}