-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement
Milestone
Description
Neale Upstone opened SPR-7210 and commented
The following is required to use ContentNegotiatingViewResolver for XML and JSON.
The two views are inconsistent in how they determine what should be rendered. This could be improved, at least by having them implement one interface and a consistent behaviour, but possibly also by allowing the key to result bean to be specified in the view resolver.
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="order" value="1" />
<property name="mediaTypes">
<map>
<entry key="json" value="application/json" />
<entry key="xml" value="application/xml" />
</map>
</property>
<property name="defaultViews">
<list>
<bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView" >
<property name="renderedAttributes" value="result.key"/>
</bean>
<bean class="org.springframework.web.servlet.view.xml.MarshallingView">
<property name="modelKey" value="result.key"/>
<property name="marshaller" ref="xstreamMarshaller"/>
</bean>
</list>
</property>
<property name="ignoreAcceptHeader" value="true" />
</bean>
Affects: 3.0.2
Referenced from: commits 5797fe7
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancementA general enhancement