Document alternatives of using multiple PropertyPlaceholderConfigurer
s [SPR-9989] #14623
Closed
Description
Johann Vanackere opened SPR-9989 and commented
When using multiple PropertyPlaceholderConfigurer
in conjunction with @Value
annotation and default value for placeholders syntax (ie ${key:defaultValue}
), only the first PropertyPlaceholderConfigurer
is used. If this configurer does not contain the desired value, it falls back to @Value
default even if the second PropertyPlaceholderConfigurer
contains the value.
You'll find attached a JUnit test case with Spring xml context to reproduce the issue.
Affects: 3.1.3
Attachments:
- PropertyPlaceholderDefaultValueTest.java (1010 bytes)
- propertyPlaceholder-test.xml (1.31 kB)
- test-spring-placeholder.zip (4.84 kB)
Issue Links:
- Default resolved property value is not working properly [SPR-10619] #15247 Default resolved property value is not working properly ("is duplicated by")
- Multiple PropertySourcesPlaceholderConfigurers do not work with placeholder defaults [SPR-10240] #14873 Multiple PropertySourcesPlaceholderConfigurers do not work with placeholder defaults ("is duplicated by")
- Improve property placeholder resolution when multiple configurers are declared [SPR-10654] #15282 Improve property placeholder resolution when multiple configurers are declared ("is duplicated by")
Referenced from: commits spring-attic/spring-framework-issues@0017731
41 votes, 43 watchers