6

如何扩展MappingJackson2HttpMessageConverter给pojo动态加字段

 3 years ago
source link: https://www.oschina.net/question/3072142_2324105
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

如何扩展MappingJackson2HttpMessageConverter给pojo动态加字段

shuaizai88 发布于 昨天 16:16
阅读 110

比如student 中包含name和age,还有一个map,这个map里可能有key1,key2  ....,我想序列化的时候把map的key1,key2直接输出成和name,age平级,并且去掉map的自动输出,结果为:

“name”:"张三",

"age",18,

"key1","key1value",

"key2":"key2value"

有现成的代码能参考下嘛??


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK