在jackson视图中遇到DEFAULT_VIEW_INCLUSION设置问题 [英] Having trouble with DEFAULT_VIEW_INCLUSION setting in jackson views

查看:935
本文介绍了在jackson视图中遇到DEFAULT_VIEW_INCLUSION设置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://wiki.fasterxml.com/JacksonJsonViews 上关于杰克逊观点的官方文档说您使用此类行来排除未显式映射到视图的属性。

The official docs on Jackson views at http://wiki.fasterxml.com/JacksonJsonViews says that you use this kind of line to exclude properties that are not explicitly mapped to a view.


objectMapper.configure(SerializationConfig.Feature.DEFAULT_VIEW_INCLUSION,false);

objectMapper.configure(SerializationConfig.Feature.DEFAULT_VIEW_INCLUSION, false);

这就是我想做的 - 但这条线并没有为我编译。有人使用这个配置指令吗?

That is what I want to do -- but the line is not compiling for me. Anybody using this config directive?

推荐答案

通过2.0版本的重新设计/重构,它被移动到 MapperFeature.DEFAULT_VIEW_INCLUSION

With the redesigns/refactorings of the 2.0 release, it got moved to MapperFeature.DEFAULT_VIEW_INCLUSION.

这篇关于在jackson视图中遇到DEFAULT_VIEW_INCLUSION设置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆