Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
0fb8f0b4
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0fb8f0b4
编写于
10月 13, 2014
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
8760be7d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
20 deletion
+20
-20
spring-web/src/main/java/org/springframework/http/HttpHeaders.java
...b/src/main/java/org/springframework/http/HttpHeaders.java
+19
-19
spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java
...va/org/springframework/web/servlet/DispatcherServlet.java
+1
-1
未找到文件。
spring-web/src/main/java/org/springframework/http/HttpHeaders.java
浏览文件 @
0fb8f0b4
...
...
@@ -43,7 +43,8 @@ import org.springframework.util.StringUtils;
/**
* Represents HTTP request and response headers, mapping string header names to list of string values.
*
* <p>In addition to the normal methods defined by {@link Map}, this class offers the following convenience methods:
* <p>In addition to the normal methods defined by {@link Map}, this class offers the following
* convenience methods:
* <ul>
* <li>{@link #getFirst(String)} returns the first value associated with a given header name</li>
* <li>{@link #add(String, String)} adds a header value to the list of values for a header name</li>
...
...
@@ -329,9 +330,17 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
private
static
TimeZone
GMT
=
TimeZone
.
getTimeZone
(
"GMT"
);
private
final
Map
<
String
,
List
<
String
>>
headers
;
/**
* Constructs a new, empty instance of the {@code HttpHeaders} object.
*/
public
HttpHeaders
()
{
this
(
new
LinkedCaseInsensitiveMap
<
List
<
String
>>(
8
,
Locale
.
ENGLISH
),
false
);
}
/**
* Private constructor that can create read-only {@code HttpHeader} instances.
*/
...
...
@@ -351,19 +360,6 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
}
}
/**
* Constructs a new, empty instance of the {@code HttpHeaders} object.
*/
public
HttpHeaders
()
{
this
(
new
LinkedCaseInsensitiveMap
<
List
<
String
>>(
8
,
Locale
.
ENGLISH
),
false
);
}
/**
* Returns {@code HttpHeaders} object that can only be read, not written to.
*/
public
static
HttpHeaders
readOnlyHttpHeaders
(
HttpHeaders
headers
)
{
return
new
HttpHeaders
(
headers
,
true
);
}
/**
* Set the list of acceptable {@linkplain MediaType media types}, as specified by the {@code Accept} header.
...
...
@@ -612,7 +608,6 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
* the {@code Expires} header.
* <p>The date is returned as the number of milliseconds since January 1, 1970 GMT.
* Returns -1 when the date is unknown.
*
* @return the expires value
*/
public
long
getExpires
()
{
...
...
@@ -786,8 +781,6 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
return
getFirst
(
UPGRADE
);
}
// Date methods
/**
* Parse the first header value for the given header name as a date, return -1 if
* there is no value, or raise {@link IllegalArgumentException} if the value cannot be
...
...
@@ -823,8 +816,6 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
set
(
headerName
,
dateFormat
.
format
(
new
Date
(
date
)));
}
// Single string methods
/**
* Return the first header value for the given header name, if any.
* @param headerName the header name
...
...
@@ -885,6 +876,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
return
singleValueMap
;
}
// Map implementation
@Override
...
...
@@ -970,4 +962,12 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
return
this
.
headers
.
toString
();
}
/**
* Return a {@code HttpHeaders} object that can only be read, not written to.
*/
public
static
HttpHeaders
readOnlyHttpHeaders
(
HttpHeaders
headers
)
{
return
new
HttpHeaders
(
headers
,
true
);
}
}
spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java
浏览文件 @
0fb8f0b4
...
...
@@ -1282,7 +1282,7 @@ public class DispatcherServlet extends FrameworkServlet {
}
private
void
triggerAfterCompletionWithError
(
HttpServletRequest
request
,
HttpServletResponse
response
,
HandlerExecutionChain
mappedHandler
,
Error
error
)
throws
Exception
,
ServletException
{
HandlerExecutionChain
mappedHandler
,
Error
error
)
throws
Exception
{
ServletException
ex
=
new
NestedServletException
(
"Handler processing failed"
,
error
);
if
(
mappedHandler
!=
null
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录