I'd like to do what's suggested here, namely:
objectMapper.setVisibility(JsonMethod.FIELD, Visibility.ANY);
Unfortunately the Json mapping for my app is done entirely in xml, like this:
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="contentNegotiationManager" ref="contentNegotiationManager"/>
<property name="defaultViews">
<list>
<bean name="jsonView" class="org.springframework.web.servlet.view.json.MappingJackson2JsonView"/>
</list>
</property>
</bean>
I don't need a custom ObjectMapper, I'd just like to be able to set the visibility of the default ObjectMapper that is used by MappingJackson2JsonView.
Is there any way to do this?