@JsonIgnore注解
来源:互联网 发布:龙诚健康大数据 编辑:程序博客网 时间:2024/05/21 10:43
很简单的一个注解,标在Javabean的属性上,作用是在将ResponseBody中的Javabean返回前端过程中,被springmvc自带的jackson转化成json字符串时,忽略这个属性。对序列化也有影响。
public class Xxx { private String attr1; @JsonIgnore private String attr2; public void setAttr1(String attr){ this.attr1 = attr; } public void setAttr2(String attr){ this.attr2 = attr; }}
上面的attr2就不会出现在响应中。
(PS:今天上班,被老大要求把某个类的ID标上这个注解,当时挺纳闷,把ID放在前端的隐藏域不是可以方便前端操作吗,然后老大说API上规定的不可以让前端知道,原来我们只写后端API,前端不是我们公司做。。。)
阅读全文
0 0
- @JsonIgnore 注解
- @JsonIgnore注解
- @JsonIgnore注解的使用
- @JsonIgnore
- @JsonIgnore
- 注解@JsonIgnore的使用方法及其效果
- 关于双向多对一的@JsonIgnore注解使用方法
- 使用@JsonProperty解决无法同时使用@JsonIgnore及@NotNull注解
- Hibernate JPA中@Transient、@JsonIgnoreProperties、@JsonIgnore、@JsonFormat、@JsonSerialize等注解解释
- Hibernate JPA中@Transient、@JsonIgnoreProperties、@JsonIgnore、@JsonFormat、@JsonSerialize等注解解释
- Hibernate JPA中@Transient、@JsonIgnoreProperties、@JsonIgnore、@JsonFormat、@JsonSerialize等注解解释
- Hibernate JPA中@Transient、@JsonIgnoreProperties、@JsonIgnore、@JsonFormat、@JsonSerialize等注解解释
- @JsonIgnore作用
- 级联递归使用@JsonIgnore
- spring rest @JsonIgnore
- @jsonignore的使用
- @jsonignore的作用
- @jsonIgnore不生效
- php编译参数详解
- wk2168驱动调试(一)
- HDU1054 Strategic Game(二分图最小点集覆盖,König定理)
- bootstrapTable后端分页
- debian 8.2 + apt-get + mongodb 3.2
- @JsonIgnore注解
- CDH 自定义添加Spark2服务
- Mybatis 小总结
- 一名前端工程师的自学之路,Js篇(11-16更新)
- 菜鸟(第二题)
- Android RecyclerView更新某条/一条数据
- 输入n,计算2的n次幂
- UDP打洞(成功打洞)
- 友盟数据平台负责人吴磊:移动大数据平台的架构与实践