Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
4c498330
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 搜索 >>
提交
4c498330
编写于
4月 26, 2019
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
4bfa2cce
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
61 addition
and
66 deletion
+61
-66
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java
...dler/invocation/AsyncHandlerMethodReturnValueHandler.java
+6
-6
spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java
...ngframework/messaging/support/AbstractMessageChannel.java
+3
-3
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
...in/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
+6
-6
spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java
...a/org/springframework/oxm/support/AbstractMarshaller.java
+5
-5
spring-tx/src/main/java/org/springframework/transaction/annotation/Propagation.java
...g/springframework/transaction/annotation/Propagation.java
+3
-3
spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java
...p/converter/xml/Jaxb2RootElementHttpMessageConverter.java
+7
-8
spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java
...mework/http/converter/xml/SourceHttpMessageConverter.java
+5
-5
spring-web/src/main/java/org/springframework/web/method/support/AsyncHandlerMethodReturnValueHandler.java
.../method/support/AsyncHandlerMethodReturnValueHandler.java
+5
-4
spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContextUtils.java
...ingframework/web/servlet/support/RequestContextUtils.java
+10
-11
spring-webmvc/src/main/java/org/springframework/web/servlet/view/RedirectView.java
...va/org/springframework/web/servlet/view/RedirectView.java
+7
-7
spring-webmvc/src/test/java/org/springframework/web/servlet/SimpleWebApplicationContext.java
...ingframework/web/servlet/SimpleWebApplicationContext.java
+4
-8
未找到文件。
spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AsyncHandlerMethodReturnValueHandler.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
5
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -42,8 +42,8 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur
* {@link #supportsReturnType(org.springframework.core.MethodParameter)}
* is called and it returns {@code true}.
* @param returnValue the value returned from the handler method
* @param returnType the type of the return value
.
* @return
true if the return value type represents an async value.
* @param returnType the type of the return value
* @return
{@code true} if the return value type represents an async value
*/
boolean
isAsyncReturnValue
(
Object
returnValue
,
MethodParameter
returnType
);
...
...
@@ -57,9 +57,9 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur
* {@link #supportsReturnType(org.springframework.core.MethodParameter)}
* is called and it returns {@code true}.
* @param returnValue the value returned from the handler method
* @param returnType the type of the return value
.
* @return the resulting ListenableFuture
or {@code null} in which case no
*
further handling will be performed.
* @param returnType the type of the return value
* @return the resulting ListenableFuture
, or {@code null} in which case
*
no further handling will be performed
*/
ListenableFuture
<?>
toListenableFuture
(
Object
returnValue
,
MethodParameter
returnType
);
...
...
spring-messaging/src/main/java/org/springframework/messaging/support/AbstractMessageChannel.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -41,10 +41,10 @@ public abstract class AbstractMessageChannel implements MessageChannel, Intercep
protected
final
Log
logger
=
LogFactory
.
getLog
(
getClass
());
private
final
List
<
ChannelInterceptor
>
interceptors
=
new
ArrayList
<
ChannelInterceptor
>(
5
);
private
String
beanName
;
private
final
List
<
ChannelInterceptor
>
interceptors
=
new
ArrayList
<
ChannelInterceptor
>(
5
);
public
AbstractMessageChannel
()
{
this
.
beanName
=
getClass
().
getSimpleName
()
+
"@"
+
ObjectUtils
.
getIdentityHexString
(
this
);
...
...
spring-oxm/src/main/java/org/springframework/oxm/jaxb/Jaxb2Marshaller.java
浏览文件 @
4c498330
...
...
@@ -337,8 +337,8 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
/**
* Set the resource resolver, as used to load the schema resources.
* @see SchemaFactory#setResourceResolver(org.w3c.dom.ls.LSResourceResolver)
* @see #setSchema
(Resource)
* @see #setSchemas
(Resource[])
* @see #setSchema
* @see #setSchemas
*/
public
void
setSchemaResourceResolver
(
LSResourceResolver
schemaResourceResolver
)
{
this
.
schemaResourceResolver
=
schemaResourceResolver
;
...
...
@@ -401,7 +401,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
/**
* Indicate
s
whether DTD parsing should be supported.
* Indicate whether DTD parsing should be supported.
* <p>Default is {@code false} meaning that DTD is disabled.
*/
public
void
setSupportDtd
(
boolean
supportDtd
)
{
...
...
@@ -409,14 +409,14 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
/**
*
W
hether DTD parsing is supported.
*
Return w
hether DTD parsing is supported.
*/
public
boolean
isSupportDtd
()
{
return
this
.
supportDtd
;
}
/**
* Indicate
s
whether external XML entities are processed when unmarshalling.
* Indicate whether external XML entities are processed when unmarshalling.
* <p>Default is {@code false}, meaning that external entities are not resolved.
* Note that processing of external entities will only be enabled/disabled when the
* {@code Source} passed to {@link #unmarshal(Source)} is a {@link SAXSource} or
...
...
@@ -433,7 +433,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
/**
* Return
s the configured value for
whether XML external entities are allowed.
* Return whether XML external entities are allowed.
*/
public
boolean
isProcessExternalEntities
()
{
return
this
.
processExternalEntities
;
...
...
spring-oxm/src/main/java/org/springframework/oxm/support/AbstractMarshaller.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -82,7 +82,7 @@ public abstract class AbstractMarshaller implements Marshaller, Unmarshaller {
/**
* Indicate
s
whether DTD parsing should be supported.
* Indicate whether DTD parsing should be supported.
* <p>Default is {@code false} meaning that DTD is disabled.
*/
public
void
setSupportDtd
(
boolean
supportDtd
)
{
...
...
@@ -90,14 +90,14 @@ public abstract class AbstractMarshaller implements Marshaller, Unmarshaller {
}
/**
*
W
hether DTD parsing is supported.
*
Return w
hether DTD parsing is supported.
*/
public
boolean
isSupportDtd
()
{
return
this
.
supportDtd
;
}
/**
* Indicate
s
whether external XML entities are processed when unmarshalling.
* Indicate whether external XML entities are processed when unmarshalling.
* <p>Default is {@code false}, meaning that external entities are not resolved.
* Note that processing of external entities will only be enabled/disabled when the
* {@code Source} passed to {@link #unmarshal(Source)} is a {@link SAXSource} or
...
...
@@ -114,7 +114,7 @@ public abstract class AbstractMarshaller implements Marshaller, Unmarshaller {
}
/**
* Return
s the configured value for
whether XML external entities are allowed.
* Return whether XML external entities are allowed.
* @see #createXmlReader()
*/
public
boolean
isProcessExternalEntities
()
{
...
...
spring-tx/src/main/java/org/springframework/transaction/annotation/Propagation.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
8
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -40,7 +40,7 @@ public enum Propagation {
* Support a current transaction, execute non-transactionally if none exists.
* Analogous to EJB transaction attribute of the same name.
* <p>Note: For transaction managers with transaction synchronization,
*
PROPAGATION_SUPPORTS
is slightly different from no transaction at all,
*
{@code SUPPORTS}
is slightly different from no transaction at all,
* as it defines a transaction scope that synchronization will apply for.
* As a consequence, the same resources (JDBC Connection, Hibernate Session, etc)
* will be shared for the entire specified scope. Note that this depends on
...
...
@@ -87,7 +87,7 @@ public enum Propagation {
/**
* Execute within a nested transaction if a current transaction exists,
* behave like
PROPAGATION_REQUIRED
else. There is no analogous feature in EJB.
* behave like
{@code REQUIRED}
else. There is no analogous feature in EJB.
* <p>Note: Actual creation of a nested transaction will only work on specific
* transaction managers. Out of the box, this only applies to the JDBC
* DataSourceTransactionManager when working on a JDBC 3.0 driver.
...
...
spring-web/src/main/java/org/springframework/http/converter/xml/Jaxb2RootElementHttpMessageConverter.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
8
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -54,9 +54,8 @@ import org.springframework.util.ClassUtils;
* {@link XmlType}, and write classes annotated with {@link XmlRootElement},
* or subclasses thereof.
*
* <p>Note that if using Spring's Marshaller/Unmarshaller abstractions from the
* {@code spring-oxm} module you should can the
* {@link MarshallingHttpMessageConverter} instead.
* <p>Note: When using Spring's Marshaller/Unmarshaller abstractions from {@code spring-oxm},
* you should use the {@link MarshallingHttpMessageConverter} instead.
*
* @author Arjen Poutsma
* @author Sebastien Deleuze
...
...
@@ -72,7 +71,7 @@ public class Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessa
/**
* Indicate
s
whether DTD parsing should be supported.
* Indicate whether DTD parsing should be supported.
* <p>Default is {@code false} meaning that DTD is disabled.
*/
public
void
setSupportDtd
(
boolean
supportDtd
)
{
...
...
@@ -80,14 +79,14 @@ public class Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessa
}
/**
*
W
hether DTD parsing is supported.
*
Return w
hether DTD parsing is supported.
*/
public
boolean
isSupportDtd
()
{
return
this
.
supportDtd
;
}
/**
* Indicate
s
whether external XML entities are processed when converting to a Source.
* Indicate whether external XML entities are processed when converting to a Source.
* <p>Default is {@code false}, meaning that external entities are not resolved.
* <p><strong>Note:</strong> setting this option to {@code true} also
* automatically sets {@link #setSupportDtd} to {@code true}.
...
...
@@ -100,7 +99,7 @@ public class Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessa
}
/**
* Return
s the configured value for
whether XML external entities are allowed.
* Return whether XML external entities are allowed.
*/
public
boolean
isProcessExternalEntities
()
{
return
this
.
processExternalEntities
;
...
...
spring-web/src/main/java/org/springframework/http/converter/xml/SourceHttpMessageConverter.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -94,7 +94,7 @@ public class SourceHttpMessageConverter<T extends Source> extends AbstractHttpMe
/**
* Indicate
s
whether DTD parsing should be supported.
* Indicate whether DTD parsing should be supported.
* <p>Default is {@code false} meaning that DTD is disabled.
*/
public
void
setSupportDtd
(
boolean
supportDtd
)
{
...
...
@@ -102,14 +102,14 @@ public class SourceHttpMessageConverter<T extends Source> extends AbstractHttpMe
}
/**
*
W
hether DTD parsing is supported.
*
Return w
hether DTD parsing is supported.
*/
public
boolean
isSupportDtd
()
{
return
this
.
supportDtd
;
}
/**
* Indicate
s
whether external XML entities are processed when converting to a Source.
* Indicate whether external XML entities are processed when converting to a Source.
* <p>Default is {@code false}, meaning that external entities are not resolved.
* <p><strong>Note:</strong> setting this option to {@code true} also
* automatically sets {@link #setSupportDtd} to {@code true}.
...
...
@@ -122,7 +122,7 @@ public class SourceHttpMessageConverter<T extends Source> extends AbstractHttpMe
}
/**
* Return
s the configured value for
whether XML external entities are allowed.
* Return whether XML external entities are allowed.
*/
public
boolean
isProcessExternalEntities
()
{
return
this
.
processExternalEntities
;
...
...
spring-web/src/main/java/org/springframework/web/method/support/AsyncHandlerMethodReturnValueHandler.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
5
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -27,7 +27,8 @@ import org.springframework.core.MethodParameter;
* For example custom (async) handlers, by default ordered after built-in
* handlers, should take precedence over {@code @ResponseBody} or
* {@code @ModelAttribute} handling, which should occur once the async value is
* ready.
* ready. By contrast, built-in (async) handlers are already ordered ahead of
* sync handlers.
*
* @author Rossen Stoyanchev
* @since 4.2
...
...
@@ -36,9 +37,9 @@ public interface AsyncHandlerMethodReturnValueHandler extends HandlerMethodRetur
/**
* Whether the given return value represents asynchronous computation.
* @param returnValue the
return value
* @param returnValue the
value returned from the handler method
* @param returnType the return type
* @return {@code true} if the return value
is asynchronous.
* @return {@code true} if the return value
type represents an async value
*/
boolean
isAsyncReturnValue
(
Object
returnValue
,
MethodParameter
returnType
);
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/support/RequestContextUtils.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
5
the original author or authors.
* Copyright 2002-201
8
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.
...
...
@@ -256,9 +256,8 @@ public abstract class RequestContextUtils {
}
/**
* Return a read-only {@link Map} with "input" flash attributes saved on a
* previous request.
* @param request the current request
* Return read-only "input" flash attributes from request before redirect.
* @param request current request
* @return a read-only Map, or {@code null} if not found
* @see FlashMap
*/
...
...
@@ -268,20 +267,20 @@ public abstract class RequestContextUtils {
}
/**
* Return
the "output" FlashMap with attributes to save for a subsequent reques
t.
* @param request
the
current request
* @return a {@link FlashMap} instance
(never {@code null} within a DispatcherServlet request)
*
@see FlashMap
* Return
"output" FlashMap to save attributes for request after redirec
t.
* @param request current request
* @return a {@link FlashMap} instance
, never {@code null} within a
*
{@code DispatcherServlet}-handled request
*/
public
static
FlashMap
getOutputFlashMap
(
HttpServletRequest
request
)
{
return
(
FlashMap
)
request
.
getAttribute
(
DispatcherServlet
.
OUTPUT_FLASH_MAP_ATTRIBUTE
);
}
/**
* Return the FlashMapManager instance to save flash attributes with
* before a redirect.
* Return the {@code FlashMapManager} instance to save flash attributes.
* @param request the current request
* @return a {@link FlashMapManager} instance (never {@code null} within a DispatcherServlet request)
* @return a {@link FlashMapManager} instance, never {@code null} within a
* {@code DispatcherServlet}-handled request
*/
public
static
FlashMapManager
getFlashMapManager
(
HttpServletRequest
request
)
{
return
(
FlashMapManager
)
request
.
getAttribute
(
DispatcherServlet
.
FLASH_MAP_MANAGER_ATTRIBUTE
);
...
...
spring-webmvc/src/main/java/org/springframework/web/servlet/view/RedirectView.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
6
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -371,7 +371,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
* attributes or URI variables from the current request. Model attributes
* referenced in the URL are removed from the model.
* @param targetUrl the redirect URL
* @param model Map that contains model attributes
* @param model
a
Map that contains model attributes
* @param currentUriVariables current request URI variables to use
* @param encodingScheme the encoding scheme to use
* @throws UnsupportedEncodingException if string encoding failed
...
...
@@ -438,7 +438,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
* Append query properties to the redirect URL.
* Stringifies, URL-encodes and formats model attributes as query properties.
* @param targetUrl the StringBuilder to append the properties to
* @param model Map that contains model attributes
* @param model
a
Map that contains model attributes
* @param encodingScheme the encoding scheme to use
* @throws UnsupportedEncodingException if string encoding failed
* @see #queryProperties
...
...
@@ -557,8 +557,9 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
/**
* Determine whether the given model element value is eligible for exposure.
* <p>The default implementation considers primitives, Strings, Numbers, Dates,
* URIs, URLs and Locale objects as eligible. This can be overridden in subclasses.
* <p>The default implementation considers primitives, strings, numbers, dates,
* URIs, URLs etc as eligible, according to {@link BeanUtils#isSimpleValueType}.
* This can be overridden in subclasses.
* @param value the model element value
* @return whether the element value is eligible
* @see BeanUtils#isSimpleValueType
...
...
@@ -575,7 +576,6 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
* @return the encoded output String
* @throws UnsupportedEncodingException if thrown by the JDK URLEncoder
* @see java.net.URLEncoder#encode(String, String)
* @see java.net.URLEncoder#encode(String)
*/
protected
String
urlEncode
(
String
input
,
String
encodingScheme
)
throws
UnsupportedEncodingException
{
return
(
input
!=
null
?
URLEncoder
.
encode
(
input
,
encodingScheme
)
:
null
);
...
...
@@ -605,7 +605,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
}
/**
* Send a redirect back to the HTTP client
* Send a redirect back to the HTTP client
.
* @param request current HTTP request (allows for reacting to request method)
* @param response current HTTP response (for sending response headers)
* @param targetUrl the target URL to redirect to
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/SimpleWebApplicationContext.java
浏览文件 @
4c498330
/*
* Copyright 2002-201
5
the original author or authors.
* Copyright 2002-201
9
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.
...
...
@@ -47,10 +47,6 @@ public class SimpleWebApplicationContext extends StaticWebApplicationContext {
@Override
public
void
refresh
()
throws
BeansException
{
MutablePropertyValues
pvs
=
new
MutablePropertyValues
();
pvs
.
add
(
"commandClass"
,
"org.springframework.tests.sample.beans.TestBean"
);
pvs
.
add
(
"formView"
,
"form"
);
registerSingleton
(
"/locale.do"
,
LocaleChecker
.
class
);
addMessage
(
"test"
,
Locale
.
ENGLISH
,
"test message"
);
...
...
@@ -63,7 +59,7 @@ public class SimpleWebApplicationContext extends StaticWebApplicationContext {
registerSingleton
(
"handlerMapping"
,
BeanNameUrlHandlerMapping
.
class
);
registerSingleton
(
"viewResolver"
,
InternalResourceViewResolver
.
class
);
pvs
=
new
MutablePropertyValues
();
MutablePropertyValues
pvs
=
new
MutablePropertyValues
();
pvs
.
add
(
"location"
,
"org/springframework/web/context/WEB-INF/sessionContext.xml"
);
registerSingleton
(
"viewResolver2"
,
XmlViewResolver
.
class
,
pvs
);
...
...
@@ -74,10 +70,10 @@ public class SimpleWebApplicationContext extends StaticWebApplicationContext {
public
static
class
LocaleChecker
implements
Controller
,
LastModified
{
@Override
@SuppressWarnings
(
"deprecation"
)
public
ModelAndView
handleRequest
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
ServletException
,
IOException
{
if
(!(
RequestContextUtils
.
getWebApplicationContext
(
request
)
instanceof
SimpleWebApplicationContext
))
{
if
(!(
RequestContextUtils
.
findWebApplicationContext
(
request
)
instanceof
SimpleWebApplicationContext
))
{
throw
new
ServletException
(
"Incorrect WebApplicationContext"
);
}
if
(!(
RequestContextUtils
.
getLocaleResolver
(
request
)
instanceof
AcceptHeaderLocaleResolver
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录