Add options to configure content negotiation

The MVC Java config and the MVC namespace now support options to
configure content negotiation. By default both support checking path
extensions first and the "Accept" header second. For path extensions
.json, .xml, .atom, and .rss are recognized out of the box if the
Jackson, JAXB2, or Rome libraries are available. The ServletContext
and the Java Activation Framework may be used as fallback options
for path extension lookups.

Issue: SPR-8420
This commit is contained in:
Rossen Stoyanchev
2012-07-20 21:12:13 -04:00
parent 92759ed1f8
commit 028e15faa3
17 changed files with 638 additions and 50 deletions

View File

@@ -120,6 +120,22 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="content-negotiation-manager" type="xsd:string">
<xsd:annotation>
<xsd:documentation source="java:org.springframework.web.accept.ContentNegotiationManager"><![CDATA[
The bean name of a ContentNegotiationManager that is to be used to determine requested media types. If not specified,
a default ContentNegotiationManager is configured that checks the request path extension first and the "Accept" header
second where path extensions such as ".json", ".xml", ".atom", and ".rss" are recognized if Jackson, JAXB2, or the
Rome libraries are available. As a fallback option, the path extension is also used to perform a lookup through
the ServletContext and the Java Activation Framework (if available).
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
<tool:expected-type type="java:org.springframework.web.accept.ContentNegotiationManager" />
</tool:annotation>
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="message-codes-resolver" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[