Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
fc361844
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,发现更多精彩内容 >>
提交
fc361844
编写于
1月 22, 2014
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
Issue: SPR-11297
上级
52d050d2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
17 deletion
+16
-17
spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java
...ngframework/core/env/SystemEnvironmentPropertySource.java
+7
-7
spring-web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java
...ontext/support/AnnotationConfigWebApplicationContext.java
+3
-4
spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java
...ework/web/context/support/StandardServletEnvironment.java
+4
-4
spring-web/src/main/java/org/springframework/web/context/support/XmlWebApplicationContext.java
...amework/web/context/support/XmlWebApplicationContext.java
+2
-2
未找到文件。
spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java
浏览文件 @
fc361844
...
...
@@ -51,8 +51,8 @@ import org.springframework.util.Assert;
* <p>Enable debug- or trace-level logging for this class (or package) for messages
* explaining when these 'property name resolutions' occur.
*
* <p>This property source is included by default in {@link StandardEnvironment}
and all
* its subclasses.
* <p>This property source is included by default in {@link StandardEnvironment}
*
and all
its subclasses.
*
* @author Chris Beams
* @since 3.1
...
...
@@ -76,7 +76,7 @@ public class SystemEnvironmentPropertySource extends MapPropertySource {
*/
@Override
public
boolean
containsProperty
(
String
name
)
{
return
getProperty
(
name
)
!=
null
;
return
(
getProperty
(
name
)
!=
null
)
;
}
/**
...
...
@@ -89,9 +89,8 @@ public class SystemEnvironmentPropertySource extends MapPropertySource {
Assert
.
notNull
(
name
,
"property name must not be null"
);
String
actualName
=
resolvePropertyName
(
name
);
if
(
logger
.
isDebugEnabled
()
&&
!
name
.
equals
(
actualName
))
{
logger
.
debug
(
String
.
format
(
"PropertySource [%s] does not contain '%s', but found equivalent '%s'"
,
this
.
getName
(),
name
,
actualName
));
logger
.
debug
(
String
.
format
(
"PropertySource [%s] does not contain '%s', but found equivalent '%s'"
,
getName
(),
name
,
actualName
));
}
return
super
.
getProperty
(
actualName
);
}
...
...
@@ -115,7 +114,8 @@ public class SystemEnvironmentPropertySource extends MapPropertySource {
if
(!
name
.
equals
(
ucName
))
{
if
(
super
.
containsProperty
(
ucName
))
{
return
ucName
;
}
else
{
}
else
{
String
usUcName
=
ucName
.
replace
(
'.'
,
'_'
);
if
(!
ucName
.
equals
(
usUcName
)
&&
super
.
containsProperty
(
usUcName
))
{
return
usUcName
;
...
...
spring-web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java
浏览文件 @
fc361844
...
...
@@ -186,18 +186,17 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
@Override
protected
void
loadBeanDefinitions
(
DefaultListableBeanFactory
beanFactory
)
{
AnnotatedBeanDefinitionReader
reader
=
new
AnnotatedBeanDefinitionReader
(
beanFactory
);
reader
.
setEnvironment
(
this
.
getEnvironment
());
reader
.
setEnvironment
(
getEnvironment
());
ClassPathBeanDefinitionScanner
scanner
=
new
ClassPathBeanDefinitionScanner
(
beanFactory
);
scanner
.
setEnvironment
(
this
.
getEnvironment
());
scanner
.
setEnvironment
(
getEnvironment
());
BeanNameGenerator
beanNameGenerator
=
getBeanNameGenerator
();
ScopeMetadataResolver
scopeMetadataResolver
=
getScopeMetadataResolver
();
if
(
beanNameGenerator
!=
null
)
{
reader
.
setBeanNameGenerator
(
beanNameGenerator
);
scanner
.
setBeanNameGenerator
(
beanNameGenerator
);
beanFactory
.
registerSingleton
(
AnnotationConfigUtils
.
CONFIGURATION_BEAN_NAME_GENERATOR
,
beanNameGenerator
);
beanFactory
.
registerSingleton
(
AnnotationConfigUtils
.
CONFIGURATION_BEAN_NAME_GENERATOR
,
beanNameGenerator
);
}
if
(
scopeMetadataResolver
!=
null
)
{
reader
.
setScopeMetadataResolver
(
scopeMetadataResolver
);
...
...
spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java
浏览文件 @
fc361844
...
...
@@ -67,10 +67,10 @@ public class StandardServletEnvironment extends StandardEnvironment implements C
* {@value #JNDI_PROPERTY_SOURCE_NAME}.
* <p>Properties in any of the above will take precedence over system properties and
* environment variables contributed by the {@link StandardEnvironment} superclass.
* <p>The {@code Servlet}-related property sources are added as
{@link
*
StubPropertySource stubs} at this stage, and will be {@linkplain
*
#initPropertySources(ServletContext, ServletConfig) fully initialized} once the actual
* {@link ServletContext} object becomes available.
* <p>The {@code Servlet}-related property sources are added as
*
{@link StubPropertySource stubs} at this stage, and will be
*
{@linkplain #initPropertySources(ServletContext, ServletConfig) fully initialized}
*
once the actual
{@link ServletContext} object becomes available.
* @see StandardEnvironment#customizePropertySources
* @see org.springframework.core.env.AbstractEnvironment#customizePropertySources
* @see ServletConfigPropertySource
...
...
spring-web/src/main/java/org/springframework/web/context/support/XmlWebApplicationContext.java
浏览文件 @
fc361844
/*
* Copyright 2002-20
09
the original author or authors.
* Copyright 2002-20
13
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.
...
...
@@ -84,7 +84,7 @@ public class XmlWebApplicationContext extends AbstractRefreshableWebApplicationC
// Configure the bean definition reader with this context's
// resource loading environment.
beanDefinitionReader
.
setEnvironment
(
this
.
getEnvironment
());
beanDefinitionReader
.
setEnvironment
(
getEnvironment
());
beanDefinitionReader
.
setResourceLoader
(
this
);
beanDefinitionReader
.
setEntityResolver
(
new
ResourceEntityResolver
(
this
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录