Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
chenpeng_fei
spring-framework
提交
54d3d782
S
spring-framework
项目概览
chenpeng_fei
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
54d3d782
编写于
9月 23, 2015
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polishing
上级
a23629f6
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
39 addition
and
32 deletion
+39
-32
spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java
...rk/beans/factory/config/PlaceholderConfigurerSupport.java
+22
-22
spring-context/src/main/java/org/springframework/scripting/ScriptEvaluator.java
...n/java/org/springframework/scripting/ScriptEvaluator.java
+2
-2
spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-location.xml
.../context/config/contextNamespaceHandlerTests-location.xml
+4
-4
spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-override.xml
.../context/config/contextNamespaceHandlerTests-override.xml
+4
-4
spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JRubyScriptTemplateTests.java
...ork/web/servlet/view/script/JRubyScriptTemplateTests.java
+2
-0
spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JythonScriptTemplateTests.java
...rk/web/servlet/view/script/JythonScriptTemplateTests.java
+2
-0
spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/NashornScriptTemplateTests.java
...k/web/servlet/view/script/NashornScriptTemplateTests.java
+3
-0
未找到文件。
spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java
浏览文件 @
54d3d782
/*
* Copyright 2002-201
3
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.
...
...
@@ -30,33 +30,33 @@ import org.springframework.util.StringValueResolver;
*
* <p>The default placeholder syntax follows the Ant / Log4J / JSP EL style:
*
*<pre class="code">${...}</pre>
*
<pre class="code">${...}</pre>
*
* Example XML bean definition:
*
*
<pre class="code">{@code
*<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
*
<property name="driverClassName" value="}${driver}{@code
"/>
*
<property name="url" value="jdbc:}${dbname}{@code
"/>
*</bean>
*
}
</pre>
*
<pre class="code">
*
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
*
<property name="driverClassName" value="${driver}
"/>
*
<property name="url" value="jdbc:${dbname}
"/>
*
</bean>
*
</pre>
*
* Example properties file:
*
* <pre class="code">
driver=com.mysql.jdbc.Driver
* <pre class="code">driver=com.mysql.jdbc.Driver
* dbname=mysql:mydb</pre>
*
* Annotated bean definitions may take advantage of property replacement using
* the {@link org.springframework.beans.factory.annotation.Value @Value} annotation:
*
*<pre class="code">@Value("${person.age}")</pre>
*
<pre class="code">@Value("${person.age}")</pre>
*
* Implementations check simple property values, lists, maps, props, and bean names
* in bean references. Furthermore, placeholder values can also cross-reference
* other placeholders, like:
*
*<pre class="code">rootPath=myrootdir
*subPath=${rootPath}/subdir</pre>
*
<pre class="code">rootPath=myrootdir
*
subPath=${rootPath}/subdir</pre>
*
* In contrast to {@link PropertyOverrideConfigurer}, subclasses of this type allow
* filling in of explicit placeholders in bean definitions.
...
...
@@ -75,9 +75,9 @@ import org.springframework.util.StringValueResolver;
*
* <p>Example XML property with default value:
*
*
<pre class="code">{@code
*
<property name="url" value="jdbc:}${dbname:defaultdb}{@code
"/>
*
}
</pre>
*
<pre class="code">
*
<property name="url" value="jdbc:${dbname:defaultdb}
"/>
*
</pre>
*
* @author Chris Beams
* @author Juergen Hoeller
...
...
@@ -107,14 +107,14 @@ public abstract class PlaceholderConfigurerSupport extends PropertyResourceConfi
/** Defaults to {@value #DEFAULT_VALUE_SEPARATOR} */
protected
String
valueSeparator
=
DEFAULT_VALUE_SEPARATOR
;
protected
boolean
ignoreUnresolvablePlaceholders
=
false
;
protected
String
nullValue
;
pr
ivate
BeanFactory
beanFactory
;
pr
otected
boolean
ignoreUnresolvablePlaceholders
=
false
;
private
String
beanName
;
private
BeanFactory
beanFactory
;
/**
* Set the prefix that a placeholder string starts with.
...
...
@@ -143,13 +143,13 @@ public abstract class PlaceholderConfigurerSupport extends PropertyResourceConfi
}
/**
* Set a value that should be treated as {@code null} when
*
resolved
as a placeholder value: e.g. "" (empty String) or "null".
* Set a value that should be treated as {@code null} when
resolved
* as a placeholder value: e.g. "" (empty String) or "null".
* <p>Note that this will only apply to full property values,
* not to parts of concatenated values.
* <p>By default, no such null value is defined. This means that
* there is no way to express {@code null} as a property
*
value
unless you explicitly map a corresponding value here.
* there is no way to express {@code null} as a property
value
* unless you explicitly map a corresponding value here.
*/
public
void
setNullValue
(
String
nullValue
)
{
this
.
nullValue
=
nullValue
;
...
...
spring-context/src/main/java/org/springframework/scripting/ScriptEvaluator.java
浏览文件 @
54d3d782
/*
* Copyright 2002-201
3
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.
...
...
@@ -44,7 +44,7 @@ public interface ScriptEvaluator {
* Evaluate the given script with the given arguments.
* @param script the ScriptSource for the script to evaluate
* @param arguments the key-value pairs to expose to the script,
* typically as script variables
. May be {@code null}.
* typically as script variables
(may be {@code null} or empty)
* @return the return value of the script, if any
* @throws ScriptCompilationException if the evaluator failed to read,
* compile or evaluate the script
...
...
spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-location.xml
浏览文件 @
54d3d782
...
...
@@ -2,7 +2,7 @@
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:context=
"http://www.springframework.org/schema/context"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-
2.5
.xsd
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-
3.0
.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
>
<context:property-placeholder
...
...
@@ -10,15 +10,15 @@
file-encoding=
"ISO-8859-1"
/>
<bean
id=
"foo"
class=
"java.lang.String"
>
<constructor-arg
value=
"${foo}"
/>
<constructor-arg
value=
"${foo}"
/>
</bean>
<bean
id=
"bar"
class=
"java.lang.String"
>
<constructor-arg
value=
"${bar}"
/>
<constructor-arg
value=
"${bar}"
/>
</bean>
<bean
id=
"spam"
class=
"java.lang.String"
>
<constructor-arg
value=
"${spam}"
/>
<constructor-arg
value=
"${spam}"
/>
</bean>
</beans>
spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-override.xml
浏览文件 @
54d3d782
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns=
"http://www.springframework.org/schema/beans"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:context=
"http://www.springframework.org/schema/context"
xmlns:util=
"http://www.springframework.org/schema/util"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-
2.5
.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-
3.1
.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-
2.5
.xsd"
>
xmlns:util=
"http://www.springframework.org/schema/util"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-
4.2
.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-
4.2
.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-
4.2
.xsd"
>
<util:properties
id=
"overrideProps"
>
<prop
key=
"date.minutes"
>
42
</prop>
</util:properties>
<context:property-override
properties-ref=
"overrideProps"
order=
"1"
/>
<context:property-override
properties-ref=
"overrideProps"
order=
"1"
/>
<bean
id=
"date"
class=
"java.util.Date"
>
<property
name=
"minutes"
value=
"10"
/>
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JRubyScriptTemplateTests.java
浏览文件 @
54d3d782
...
...
@@ -44,6 +44,7 @@ public class JRubyScriptTemplateTests {
private
ServletContext
servletContext
;
@Before
public
void
setup
()
{
this
.
webAppContext
=
mock
(
WebApplicationContext
.
class
);
...
...
@@ -81,6 +82,7 @@ public class JRubyScriptTemplateTests {
return
view
;
}
@Configuration
static
class
ScriptTemplatingConfiguration
{
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JythonScriptTemplateTests.java
浏览文件 @
54d3d782
...
...
@@ -44,6 +44,7 @@ public class JythonScriptTemplateTests {
private
ServletContext
servletContext
;
@Before
public
void
setup
()
{
this
.
webAppContext
=
mock
(
WebApplicationContext
.
class
);
...
...
@@ -81,6 +82,7 @@ public class JythonScriptTemplateTests {
return
view
;
}
@Configuration
static
class
ScriptTemplatingConfiguration
{
...
...
spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/NashornScriptTemplateTests.java
浏览文件 @
54d3d782
...
...
@@ -44,6 +44,7 @@ public class NashornScriptTemplateTests {
private
ServletContext
servletContext
;
@Before
public
void
setup
()
{
this
.
webAppContext
=
mock
(
WebApplicationContext
.
class
);
...
...
@@ -90,6 +91,7 @@ public class NashornScriptTemplateTests {
return
view
;
}
@Configuration
static
class
ScriptTemplatingConfiguration
{
...
...
@@ -103,6 +105,7 @@ public class NashornScriptTemplateTests {
}
}
@Configuration
static
class
ScriptTemplatingWithUrlConfiguration
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录