Upgraded to Jackson 1.9 (raising minimum to 1.8+) and 2.2

This commit is contained in:
Juergen Hoeller
2013-05-02 15:51:59 +02:00
parent 9f9b972f00
commit 767bd3f3f8
11 changed files with 164 additions and 188 deletions

View File

@@ -39,7 +39,7 @@ import org.springframework.web.servlet.view.AbstractView;
/**
* Spring MVC {@link View} that renders JSON content by serializing the model for the current request
* using <a href="http://jackson.codehaus.org/">Jackson 2's</a> {@link ObjectMapper}.
* using <a href="http://jackson.codehaus.org/">Jackson 2.x's</a> {@link ObjectMapper}.
*
* <p>By default, the entire contents of the model map (with the exception of framework-specific classes)
* will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as JSON
@@ -278,6 +278,8 @@ public class MappingJackson2JsonView extends AbstractView {
* @throws IOException if writing failed
*/
protected void writeContent(OutputStream stream, Object value, boolean prefixJson) throws IOException {
// The following has been deprecated as late as Jackson 2.2 (April 2013);
// preserved for the time being, for Jackson 2.0/2.1 compatibility.
JsonGenerator generator = this.objectMapper.getJsonFactory().createJsonGenerator(stream, this.encoding);
// A workaround for JsonGenerators not applying serialization features

View File

@@ -39,7 +39,7 @@ import org.springframework.web.servlet.view.AbstractView;
/**
* Spring MVC {@link View} that renders JSON content by serializing the model for the current request
* using <a href="http://jackson.codehaus.org/">Jackson's</a> {@link ObjectMapper}.
* using <a href="http://jackson.codehaus.org/">Jackson 1.x's</a> {@link ObjectMapper}.
*
* <p>By default, the entire contents of the model map (with the exception of framework-specific classes)
* will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as JSON