使用Jackson提供的json注解。

@JsonIgnore注解用来忽略某些字段,可以用在Field或者Getter方法上,用在Setter方法时,和Filed效果一样。这个注解只能用在POJO存在的字段要忽略的情况,不能满足现在需要的情况。

@JsonIgnoreProperties(ignoreUnknown = true),将这个注解写在类上之后,就会忽略类中不存在的字段,可以满足当前的需要。这个注解还可以指定要忽略的字段。使用方法如下:

@JsonIgnoreProperties({ "name", "desc" })

指定的字段不会被序列化和反序列化。

jackson反序列化报错Unrecognized field , not marked as ignorable的更多相关文章

  1. SpringMVC @RequestBody问题:Unrecognized field , not marked as ignorable

    http://blog.csdn.net/isea533/article/details/33397735

  2. com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field 异常

    分享牛原创(尊重原创 转载对的时候第一行请注明,转载出处来自分享牛http://blog.csdn.net/qq_30739519) 1.1.1. 前言 近期在使用ObjectMapper对象将jso ...

  3. com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "FileSize"

    请求阿里云的OSS接口图片信息,返回json格式的数据,通过ObjectMapper将json转为Image对象时候报错转换失败 将json转对象的代码: String jsonStr = " ...

  4. com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "ExceptionId"

    com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "Exception ...

  5. 16. nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "auditUnitName"

    org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver:handleHttpMessageNotRead ...

  6. SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'com.netflix.discovery.DiscoveryClient' that could not be found."

    SpringCloud报错: "Field discoveryClient in com.controller.DcController required a bean of type 'c ...

  7. 使用xadmin搜索search_fields报错:Related Field got invalid lookup: icontains

    一.问题描述 使用xadmin实现Django后台功能时,使用search_fields = [字段名,字段名],在搜索的时候报错Related Field got invalid lookup: i ...

  8. 报错:Unsupported field: HourOfDay

    报错:Unsupported field: HourOfDay 这个错误就比较搞笑也比较低级了. 代码如下 LocalDate now = LocalDate.now(); String year = ...

  9. 反序列化报错回显、反弹shell

    • 使用java.net.URLClassLoader类,远程加载自定义类(放在自己服务器上的jar包),可以自定义方法执行. • 在自定义类中,抛出异常,使其成功随着Jboss报错返回命令执行结果. ...

随机推荐

  1. ReplicatorLayer 复制图层

    使用文档介绍: #import <QuartzCore/CALayer.h> NS_ASSUME_NONNULL_BEGIN CA_CLASS_AVAILABLE (10.6, 3.0, ...

  2. 发布delphi程序(build with runtime package)要带哪些文件?

    Delphi提供两种方式来编译你的程序:使用包或者是单独的exe 使用包,你可以使用如下方法设置: 项目选项(菜单project->options->Packages页), 在Runtim ...

  3. charles抓包看性能数据

    1.优化某个接口或加载速度(H5加载速度慢) 抓包看Overview ①看Duration,就是接口的加载时间 ②看Latency,就是延时一端传播到另一端所花费的时间:一般和网络有关:可以综合Dur ...

  4. yii之relations关联非主键

    yii的relations里self::BELONGS_TO默认是用当前指定的键跟关联表的主键进行join,例如: return array('reply' => array(self::BEL ...

  5. 《JavaScript DOM 编程艺术》学习成果

    (在线演示地址)[http://thqy39.github.io/works/03.Js%20DOM%20website/index.html]

  6. Modify PDF operators.

    1 Depart Process: 2 1. Grep xref and trailer binary position in file. 3 2. Dump xref table and trail ...

  7. PAT甲级【2019年3月考题】——A1156 SexyPrimes【20】

    Sexy primes are pairs of primes of the form (p, p+6), so-named since “sex” is the Latin word for “si ...

  8. SSH远程免密码的密钥登录服务(Linux,Linux)

    本次实验基于两台Linux虚拟机之间的实验,一台做服务器,一台做客户机,模拟免密码的密钥登录. 首先两台虚拟机需要可以ping通,用客户机访问服务器. sshd服务主配置文件路径: /etc/ssh/ ...

  9. 转 什么是Mbps、Kbps、bps、kb、mb及其换算和区别

    Mbps 即 Milionbit pro second(百万位每秒): Kbps 即 Kilobit pro second(千位每秒): bps 即 bit pro second(位每秒): 速度单位 ...

  10. 插件化框架解读之android系统服务实现原理(五)

    阿里P7移动互联网架构师进阶视频(每日更新中)免费学习请点击:https://space.bilibili.com/474380680 一.系统服务提供方式 1.我们平时最常见的系统服务使用方式 Wi ...