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

@@ -2626,7 +2626,9 @@ simpleReport.reportDataKey=myBeanData</programlisting>
<section id="view-json-mapping">
<title>JSON Mapping View</title>
<para>The <classname>MappingJacksonJsonView</classname> uses the Jackson
<para>The <classname>MappingJackson2JsonView</classname>
(or <classname>MappingJacksonJsonView</classname> depending on the
the Jackson version you have) uses the Jackson
library's <classname>ObjectMapper</classname> to render the response content
as JSON. By default, the entire contents of the model map (with the exception
of framework-specific classes) will be encoded as JSON. For cases where the