spring -mvc 将对象封装json返回时删除掉对象中的属性注解方式

spring -mvc 将对象封装json返回时删除掉对象中的属性注解方式

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

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

 

@JsonIgnoreProperties(value={"comid"}) 

public interface 接口名称{   

}  

@JsonIgnoreProperties(value={"comid"})  

public class 类名{   

}  

 

该注解使用在get方法头上

@JsonIgnore

@JsonIgnore
public Integer 属性(){
return 属性;);
}

posted @ 2015-11-25 19:36  karlze  阅读(379)  评论(0编辑  收藏  举报