Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
fce58c6a
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,体验更适合开发者的 AI 搜索 >>
提交
fce58c6a
编写于
4月 08, 2019
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Efficient MultiValueMap.entrySet() iteration in decodeMatrixVariables
上级
54dd8336
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
18 deletion
+17
-18
spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java
...main/java/org/springframework/web/util/UrlPathHelper.java
+17
-18
未找到文件。
spring-web/src/main/java/org/springframework/web/util/UrlPathHelper.java
浏览文件 @
fce58c6a
...
...
@@ -19,6 +19,7 @@ package org.springframework.web.util;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Properties
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -494,7 +495,7 @@ public class UrlPathHelper {
/**
* Remove ";" (semicolon) content from the given request URI if the
* {@linkplain #setRemoveSemicolonContent
(boolean)
removeSemicolonContent}
* {@linkplain #setRemoveSemicolonContent removeSemicolonContent}
* property is set to "true". Note that "jssessionid" is always removed.
* @param requestUri the request URI string to remove ";" content from
* @return the updated URI string
...
...
@@ -526,12 +527,10 @@ public class UrlPathHelper {
}
/**
* Decode the given URI path variables via
* {@link #decodeRequestString(HttpServletRequest, String)} unless
* {@link #setUrlDecode(boolean)} is set to {@code true} in which case it is
* assumed the URL path from which the variables were extracted is already
* decoded through a call to
* {@link #getLookupPathForRequest(HttpServletRequest)}.
* Decode the given URI path variables via {@link #decodeRequestString} unless
* {@link #setUrlDecode} is set to {@code true} in which case it is assumed
* the URL path from which the variables were extracted is already decoded
* through a call to {@link #getLookupPathForRequest(HttpServletRequest)}.
* @param request current HTTP request
* @param vars URI variables extracted from the URL path
* @return the same Map or a new Map instance
...
...
@@ -550,25 +549,25 @@ public class UrlPathHelper {
}
/**
* Decode the given matrix variables via
* {@link #decodeRequestString(HttpServletRequest, String)} unless
* {@link #setUrlDecode(boolean)} is set to {@code true} in which case it is
* assumed the URL path from which the variables were extracted is already
* decoded through a call to
* {@link #getLookupPathForRequest(HttpServletRequest)}.
* Decode the given matrix variables via {@link #decodeRequestString} unless
* {@link #setUrlDecode} is set to {@code true} in which case it is assumed
* the URL path from which the variables were extracted is already decoded
* through a call to {@link #getLookupPathForRequest(HttpServletRequest)}.
* @param request current HTTP request
* @param vars URI variables extracted from the URL path
* @return the same Map or a new Map instance
*/
public
MultiValueMap
<
String
,
String
>
decodeMatrixVariables
(
HttpServletRequest
request
,
MultiValueMap
<
String
,
String
>
vars
)
{
public
MultiValueMap
<
String
,
String
>
decodeMatrixVariables
(
HttpServletRequest
request
,
MultiValueMap
<
String
,
String
>
vars
)
{
if
(
this
.
urlDecode
)
{
return
vars
;
}
else
{
MultiValueMap
<
String
,
String
>
decodedVars
=
new
LinkedMultiValueMap
<
String
,
String
>(
vars
.
size
());
for
(
String
key
:
vars
.
ke
ySet
())
{
for
(
String
value
:
vars
.
get
(
key
))
{
decodedVars
.
add
(
key
,
decodeInternal
(
request
,
value
));
MultiValueMap
<
String
,
String
>
decodedVars
=
new
LinkedMultiValueMap
<
String
,
String
>(
vars
.
size
());
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry
:
vars
.
entr
ySet
())
{
for
(
String
value
:
entry
.
getValue
(
))
{
decodedVars
.
add
(
entry
.
getKey
()
,
decodeInternal
(
request
,
value
));
}
}
return
decodedVars
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录