diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java index f3b35e88fea..a0152ed4478 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PlaceholderConfigurerSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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; * *

The default placeholder syntax follows the Ant / Log4J / JSP EL style: * - *

${...}
+ *
${...}
* * Example XML bean definition: * - *
{@code
- *
- *    
- *    
- *
- *}
+ *
+ * 
+ *   
+ *   
+ * 
+ * 
* * Example properties file: * - *
 driver=com.mysql.jdbc.Driver
+ * 
driver=com.mysql.jdbc.Driver
  * dbname=mysql:mydb
* * Annotated bean definitions may take advantage of property replacement using * the {@link org.springframework.beans.factory.annotation.Value @Value} annotation: * - *
@Value("${person.age}")
+ *
@Value("${person.age}")
* * Implementations check simple property values, lists, maps, props, and bean names * in bean references. Furthermore, placeholder values can also cross-reference * other placeholders, like: * - *
rootPath=myrootdir
- *subPath=${rootPath}/subdir
+ *
rootPath=myrootdir
+ * subPath=${rootPath}/subdir
* * 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; * *

Example XML property with default value: * - *

{@code
- *  
- *}
+ *
+ *   
+ * 
* * @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; - private BeanFactory beanFactory; + protected 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". *

Note that this will only apply to full property values, * not to parts of concatenated values. *

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; diff --git a/spring-context/src/main/java/org/springframework/scripting/ScriptEvaluator.java b/spring-context/src/main/java/org/springframework/scripting/ScriptEvaluator.java index eb5e115a221..918877c4e58 100644 --- a/spring-context/src/main/java/org/springframework/scripting/ScriptEvaluator.java +++ b/spring-context/src/main/java/org/springframework/scripting/ScriptEvaluator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2015 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 diff --git a/spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-location.xml b/spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-location.xml index c45826362af..e90a5e42b34 100644 --- a/spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-location.xml +++ b/spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-location.xml @@ -2,7 +2,7 @@ - + - + - + diff --git a/spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-override.xml b/spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-override.xml index 647e08ff9bf..7b6a8eb3e0b 100644 --- a/spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-override.xml +++ b/spring-context/src/test/resources/org/springframework/context/config/contextNamespaceHandlerTests-override.xml @@ -1,15 +1,15 @@ + 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"> 42 - + diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JRubyScriptTemplateTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JRubyScriptTemplateTests.java index 12d2b811152..ae894c3c235 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JRubyScriptTemplateTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JRubyScriptTemplateTests.java @@ -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 { diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JythonScriptTemplateTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JythonScriptTemplateTests.java index 16cc9559930..4c090cf9bf4 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JythonScriptTemplateTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/JythonScriptTemplateTests.java @@ -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 { diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/NashornScriptTemplateTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/NashornScriptTemplateTests.java index db33559d24a..fdb86978eea 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/NashornScriptTemplateTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/view/script/NashornScriptTemplateTests.java @@ -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 {