Add Jackson 2 HttpMessageConverter and View

Jackson 2 uses completely new package names and new maven artifact ids.
This change adds Jackson 2 as an optional dependency and also provides
MappingJackson2HttpMessageConverter and MappingJackson2JsonView for use
with the new version.

The MVC namespace and the MVC Java config detect and use
MappingJackson2HttpMessageConverter if Jackson 2 is present.
Otherwise if Jackson 1.x is present,
then MappingJacksonHttpMessageConverter is used.

Issue: SPR-9302
This commit is contained in:
Rossen Stoyanchev
2012-05-09 13:07:25 -04:00
parent 6cca57afd3
commit e63ca04fdb
14 changed files with 971 additions and 167 deletions

View File

@@ -1363,7 +1363,7 @@ if (HttpStatus.SC_CREATED == post.getStatusCode()) {
these defaults using the <methodname>messageConverters()</methodname> bean
property as would be required if using the
<classname>MarshallingHttpMessageConverter</classname> or
<classname>MappingJacksonHttpMessageConverter</classname>.</para>
<classname>MappingJackson2HttpMessageConverter</classname>.</para>
<para>Each method takes URI template arguments in two forms, either as a
<literal>String</literal> variable length argument or a
@@ -1608,7 +1608,7 @@ String body = response.getBody();</programlisting>
</section>
<section id="rest-mapping-json-converter">
<title>MappingJacksonHttpMessageConverter</title>
<title>MappingJackson2HttpMessageConverter (or MappingJacksonHttpMessageConverter with Jackson 1.x)</title>
<para>An <interfacename>HttpMessageConverter</interfacename>
implementation that can read and write JSON using Jackson's