Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wang2java
Spring Framework
提交
ae0f23e9
S
Spring Framework
项目概览
wang2java
/
Spring Framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Spring Framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ae0f23e9
编写于
7月 31, 2013
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
Issue: SPR-10752 Issue: SPR-10627
上级
b40263e0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
21 deletion
+21
-21
spring-web/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java
...p/converter/json/MappingJackson2HttpMessageConverter.java
+10
-10
spring-web/src/main/java/org/springframework/http/converter/json/MappingJacksonHttpMessageConverter.java
...tp/converter/json/MappingJacksonHttpMessageConverter.java
+3
-2
spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java
...mework/web/servlet/view/json/MappingJackson2JsonView.java
+6
-7
spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJacksonJsonView.java
...amework/web/servlet/view/json/MappingJacksonJsonView.java
+2
-2
未找到文件。
spring-web/src/main/java/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.java
浏览文件 @
ae0f23e9
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
3
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -21,6 +21,14 @@ import java.lang.reflect.Type;
import
java.nio.charset.Charset
;
import
java.util.List
;
import
com.fasterxml.jackson.core.JsonEncoding
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.util.DefaultPrettyPrinter
;
import
com.fasterxml.jackson.databind.JavaType
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
org.springframework.http.HttpInputMessage
;
import
org.springframework.http.HttpOutputMessage
;
import
org.springframework.http.MediaType
;
...
...
@@ -30,14 +38,6 @@ import org.springframework.http.converter.HttpMessageNotReadableException;
import
org.springframework.http.converter.HttpMessageNotWritableException
;
import
org.springframework.util.Assert
;
import
com.fasterxml.jackson.core.JsonEncoding
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.util.DefaultPrettyPrinter
;
import
com.fasterxml.jackson.databind.JavaType
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
/**
* Implementation of {@link org.springframework.http.converter.HttpMessageConverter HttpMessageConverter}
* that can read and write JSON using <a href="http://jackson.codehaus.org/">Jackson 2's</a> {@link ObjectMapper}.
...
...
@@ -119,7 +119,7 @@ public class MappingJackson2HttpMessageConverter extends AbstractHttpMessageConv
* @see #setJsonPrefix
*/
public
void
setPrefixJson
(
boolean
prefixJson
)
{
this
.
jsonPrefix
=
prefixJson
?
"{} && "
:
null
;
this
.
jsonPrefix
=
(
prefixJson
?
"{} && "
:
null
)
;
}
/**
...
...
spring-web/src/main/java/org/springframework/http/converter/json/MappingJacksonHttpMessageConverter.java
浏览文件 @
ae0f23e9
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
3
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -28,6 +28,7 @@ import org.codehaus.jackson.map.ObjectMapper;
import
org.codehaus.jackson.map.SerializationConfig
;
import
org.codehaus.jackson.map.type.TypeFactory
;
import
org.codehaus.jackson.type.JavaType
;
import
org.springframework.http.HttpInputMessage
;
import
org.springframework.http.HttpOutputMessage
;
import
org.springframework.http.MediaType
;
...
...
@@ -116,7 +117,7 @@ public class MappingJacksonHttpMessageConverter extends AbstractHttpMessageConve
* @see #setJsonPrefix
*/
public
void
setPrefixJson
(
boolean
prefixJson
)
{
this
.
jsonPrefix
=
prefixJson
?
"{} && "
:
null
;
this
.
jsonPrefix
=
(
prefixJson
?
"{} && "
:
null
)
;
}
/**
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJackson2JsonView.java
浏览文件 @
ae0f23e9
...
...
@@ -23,21 +23,20 @@ import java.util.Collections;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.fasterxml.jackson.core.JsonEncoding
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.servlet.View
;
import
org.springframework.web.servlet.view.AbstractView
;
import
com.fasterxml.jackson.core.JsonEncoding
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.SerializationFeature
;
/**
* 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}.
...
...
@@ -143,7 +142,7 @@ public class MappingJackson2JsonView extends AbstractView {
* @see #setJsonPrefix
*/
public
void
setPrefixJson
(
boolean
prefixJson
)
{
this
.
jsonPrefix
=
prefixJson
?
"{} && "
:
""
;
this
.
jsonPrefix
=
(
prefixJson
?
"{} && "
:
""
)
;
}
/**
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/view/json/MappingJacksonJsonView.java
浏览文件 @
ae0f23e9
...
...
@@ -23,7 +23,6 @@ import java.util.Collections;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -31,6 +30,7 @@ import org.codehaus.jackson.JsonEncoding;
import
org.codehaus.jackson.JsonGenerator
;
import
org.codehaus.jackson.map.ObjectMapper
;
import
org.codehaus.jackson.map.SerializationConfig
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.validation.BindingResult
;
...
...
@@ -142,7 +142,7 @@ public class MappingJacksonJsonView extends AbstractView {
* @see #setJsonPrefix
*/
public
void
setPrefixJson
(
boolean
prefixJson
)
{
this
.
jsonPrefix
=
prefixJson
?
"{} && "
:
""
;
this
.
jsonPrefix
=
(
prefixJson
?
"{} && "
:
""
)
;
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录