1

Short question:

is it possible to enable MapperFeature.DEFAULT_VIEW_INCLUSION Jackson feature (e.g. set it to true) in Spring using XML configuration only?

In other words I want to do what is described here: https://stackoverflow.com/a/32842962/1479414 but without creating java class, but configure it inside XML only.

It is possible to do?

Community
  • 1
  • 1
Andremoniy
  • 34,031
  • 20
  • 135
  • 241

1 Answers1

2

Since Spring 3.2, you could use Jackson2ObjectMapperFactoryBean. Something like:

<bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
    <property name="defaultViewInclusion" value="true"/>
</bean>
cassiomolin
  • 124,154
  • 35
  • 280
  • 359