Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
.-Smile-.
spring-framework
提交
1cc042d4
S
spring-framework
项目概览
.-Smile-.
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
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,发现更多精彩内容 >>
提交
1cc042d4
编写于
5月 07, 2015
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
783cb2c4
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
25 deletion
+30
-25
spring-context/src/main/java/org/springframework/context/PayloadApplicationEvent.java
.../org/springframework/context/PayloadApplicationEvent.java
+6
-2
spring-context/src/test/java/org/springframework/context/event/AnnotationDrivenEventListenerTests.java
...ork/context/event/AnnotationDrivenEventListenerTests.java
+3
-3
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
...ngframework/messaging/simp/stomp/StompHeaderAccessor.java
+16
-15
spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java
.../org/springframework/web/bind/annotation/CrossOrigin.java
+3
-3
spring-web/src/main/java/org/springframework/web/multipart/MaxUploadSizeExceededException.java
...amework/web/multipart/MaxUploadSizeExceededException.java
+2
-2
未找到文件。
spring-context/src/main/java/org/springframework/context/PayloadApplicationEvent.java
浏览文件 @
1cc042d4
...
...
@@ -33,6 +33,11 @@ public class PayloadApplicationEvent<T> extends ApplicationEvent {
private
final
T
payload
;
/**
* Create a new PayloadApplicationEvent.
* @param source the component that published the event (never {@code null})
* @param payload the payload object
*/
public
PayloadApplicationEvent
(
Object
source
,
T
payload
)
{
super
(
source
);
Assert
.
notNull
(
payload
,
"Payload must not be null"
);
...
...
@@ -44,8 +49,7 @@ public class PayloadApplicationEvent<T> extends ApplicationEvent {
* Return the payload of the event.
*/
public
T
getPayload
()
{
return
payload
;
return
this
.
payload
;
}
}
spring-context/src/test/java/org/springframework/context/event/AnnotationDrivenEventListenerTests.java
浏览文件 @
1cc042d4
...
...
@@ -636,9 +636,9 @@ public class AnnotationDrivenEventListenerTests {
}
@Override
@EventListener
(
condition
=
"
'OK'.equals(#content
)"
)
public
void
handleString
(
String
content
)
{
super
.
handleString
(
content
);
@EventListener
(
condition
=
"
#payload.startsWith('OK'
)"
)
public
void
handleString
(
String
payload
)
{
super
.
handleString
(
payload
);
}
@EventListener
(
condition
=
"#root.event.timestamp > #p0"
)
...
...
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompHeaderAccessor.java
浏览文件 @
1cc042d4
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
5
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.
...
...
@@ -218,19 +218,28 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor {
return
(
StompCommand
)
getHeader
(
COMMAND_HEADER
);
}
public
Set
<
String
>
getAcceptVersion
()
{
String
rawValue
=
getFirstNativeHeader
(
STOMP_ACCEPT_VERSION_HEADER
);
return
(
rawValue
!=
null
?
StringUtils
.
commaDelimitedListToSet
(
rawValue
)
:
Collections
.<
String
>
emptySet
());
}
public
boolean
isHeartbeat
()
{
return
(
SimpMessageType
.
HEARTBEAT
==
getMessageType
());
}
public
long
[]
getHeartbeat
()
{
String
rawValue
=
getFirstNativeHeader
(
STOMP_HEARTBEAT_HEADER
);
if
(!
StringUtils
.
hasText
(
rawValue
))
{
return
Arrays
.
copyOf
(
DEFAULT_HEARTBEAT
,
2
);
}
String
[]
rawValues
=
StringUtils
.
commaDelimitedListToStringArray
(
rawValue
);
return
new
long
[]
{
Long
.
valueOf
(
rawValues
[
0
]),
Long
.
valueOf
(
rawValues
[
1
])};
}
public
void
setAcceptVersion
(
String
acceptVersion
)
{
setNativeHeader
(
STOMP_ACCEPT_VERSION_HEADER
,
acceptVersion
);
}
public
Set
<
String
>
getAcceptVersion
()
{
String
rawValue
=
getFirstNativeHeader
(
STOMP_ACCEPT_VERSION_HEADER
);
return
(
rawValue
!=
null
?
StringUtils
.
commaDelimitedListToSet
(
rawValue
)
:
Collections
.<
String
>
emptySet
());
}
public
void
setHost
(
String
host
)
{
setNativeHeader
(
STOMP_HOST_HEADER
,
host
);
}
...
...
@@ -245,15 +254,7 @@ public class StompHeaderAccessor extends SimpMessageHeaderAccessor {
setNativeHeader
(
STOMP_DESTINATION_HEADER
,
destination
);
}
public
long
[]
getHeartbeat
()
{
String
rawValue
=
getFirstNativeHeader
(
STOMP_HEARTBEAT_HEADER
);
if
(!
StringUtils
.
hasText
(
rawValue
))
{
return
Arrays
.
copyOf
(
DEFAULT_HEARTBEAT
,
2
);
}
String
[]
rawValues
=
StringUtils
.
commaDelimitedListToStringArray
(
rawValue
);
return
new
long
[]
{
Long
.
valueOf
(
rawValues
[
0
]),
Long
.
valueOf
(
rawValues
[
1
])};
}
@Override
public
void
setContentType
(
MimeType
contentType
)
{
super
.
setContentType
(
contentType
);
setNativeHeader
(
STOMP_CONTENT_TYPE_HEADER
,
contentType
.
toString
());
...
...
spring-web/src/main/java/org/springframework/web/bind/annotation/CrossOrigin.java
浏览文件 @
1cc042d4
...
...
@@ -26,9 +26,9 @@ import java.lang.annotation.Target;
* Marks the annotated method as permitting cross origin requests.
* By default, all origins and headers are permitted.
*
* @since 4.2
* @author Russell Allen
* @author Sebastien Deleuze
* @since 4.2
*/
@Target
({
ElementType
.
METHOD
,
ElementType
.
TYPE
})
@Retention
(
RetentionPolicy
.
RUNTIME
)
...
...
@@ -37,7 +37,7 @@ public @interface CrossOrigin {
/**
* List of allowed origins. {@code "*"} means that all origins are allowed. These values
* are placed in the {@code Access-Control-Allow-Origin
} header of both the pre-flight
* are placed in the {@code Access-Control-Allow-Origin} header of both the pre-flight
* and actual responses. Default value is <b>"*"</b>.
*/
String
[]
origin
()
default
{
"*"
};
...
...
@@ -71,7 +71,7 @@ public @interface CrossOrigin {
String
allowCredentials
()
default
"true"
;
/**
* Controls the cache duration for pre-flight responses.
Setting this to a reasonable
* Controls the cache duration for pre-flight responses. Setting this to a reasonable
* value can reduce the number of pre-flight request/response interaction required by
* the browser. This property controls the value of the {@code Access-Control-Max-Age header}
* in the pre-flight response. Value set to -1 means undefined. Default value is
...
...
spring-web/src/main/java/org/springframework/web/multipart/MaxUploadSizeExceededException.java
浏览文件 @
1cc042d4
/*
* Copyright 2002-201
2
the original author or authors.
* Copyright 2002-201
5
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.
...
...
@@ -52,7 +52,7 @@ public class MaxUploadSizeExceededException extends MultipartException {
* Return the maximum upload size allowed.
*/
public
long
getMaxUploadSize
()
{
return
maxUploadSize
;
return
this
.
maxUploadSize
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录