springMvc将对象json返回时自动忽略掉对象中的特定属性的注解方式

1.注解使用在 类名,接口头上

@JsonIgnoreProperties(value={"comid"}) //希望动态过滤掉的属性  

@JsonIgnoreProperties(value={"comid"}) 
   public interface CompanyFilter{   

2.该注解使用在get方法头上

@JsonIgnore

   例  

 @JsonIgnore
    public Integer getPageSize(){
           return Integer.valueOf(getRows()==null?"0":getRows().toString());
    }

本文转自:https://blog.csdn.net/sanjay_f/article/details/47304509

原文地址:https://www.cnblogs.com/nizuimeiabc1/p/11030232.html