File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
org.springframework.context/src/main/java/org/springframework/context/annotation Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 54
54
* configuration class and then used when populating the {@code TestBean} object. Given
55
55
* the configuration above, a call to {@code testBean.getName()} will return "myTestBean".
56
56
*
57
- * <h3>Resolving placeholders within @PropertySource resource locations</h3>
57
+ * <h3>Resolving ${...} placeholders in {@code <bean>} and {@code @Value} annotations</h3>
58
+ * In order to resolve ${...} placeholders in {@code <bean>} definitions or {@code @Value}
59
+ * annotations using properties from a {@code PropertySource}, one must register
60
+ * a {@code PropertySourcesPlaceholderConfigurer}. This happens automatically when using
61
+ * {@code <context:property-placeholder>} in XML, but must be explicitly registered using
62
+ * a {@code static} {@code @Bean} method when using {@code @Configuration} classes. See
63
+ * the "Working with externalized values" section of @{@link Configuration} Javadoc and
64
+ * "a note on BeanFactoryPostProcessor-returning @Bean methods" of @{@link Bean} Javadoc
65
+ * for details and examples.
66
+ *
67
+ * <h3>Resolving ${...} placeholders within {@code @PropertySource} resource locations</h3>
58
68
* Any ${...} placeholders present in a {@code @PropertySource} {@linkplain #value()
59
69
* resource location} will be resolved against the set of property sources already
60
70
* registered against the environment. For example:
You can’t perform that action at this time.
0 commit comments