MappingJackson(2)HttpMessageConverter alignment
This commit is contained in:
@@ -42,15 +42,14 @@ import org.springframework.web.servlet.view.AbstractView;
|
||||
* 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
|
||||
* alone via {@link #setExtractValueFromSingleKeyModel}.
|
||||
* will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as
|
||||
* JSON alone via {@link #setExtractValueFromSingleKeyModel}.
|
||||
*
|
||||
* @author Jeremy Grelle
|
||||
* @author Arjen Poutsma
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.1.2
|
||||
* @see org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
|
||||
*/
|
||||
public class MappingJackson2JsonView extends AbstractView {
|
||||
|
||||
@@ -280,6 +279,7 @@ public class MappingJackson2JsonView extends AbstractView {
|
||||
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.
|
||||
@SuppressWarnings("deprecation")
|
||||
JsonGenerator generator = this.objectMapper.getJsonFactory().createJsonGenerator(stream, this.encoding);
|
||||
|
||||
// A workaround for JsonGenerators not applying serialization features
|
||||
|
||||
@@ -42,15 +42,14 @@ import org.springframework.web.servlet.view.AbstractView;
|
||||
* 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
|
||||
* alone via {@link #setExtractValueFromSingleKeyModel}.
|
||||
* will be encoded as JSON. If the model contains only one key, you can have it extracted encoded as
|
||||
* JSON alone via {@link #setExtractValueFromSingleKeyModel}.
|
||||
*
|
||||
* @author Jeremy Grelle
|
||||
* @author Arjen Poutsma
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
* @see org.springframework.http.converter.json.MappingJacksonHttpMessageConverter
|
||||
*/
|
||||
public class MappingJacksonJsonView extends AbstractView {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user