Part of the configuration magic is (one of several) Spring post-processors, that allows load the property file or files and refer to the values in these files inside XML configuration files. The rationale behind these is that property files are much easier to edit that possibly huge XML config file and using property values prevents repeating same value over and over again. With this approach, the following configuration:

[sourcecode language='xml']
 

[/sourcecode]
can be written as
[sourcecode language='xml']
 

WEB-INF/mail.properties
WEB-INF/jdbc.properties

 

 
[/sourcecode]
and (in jdbc.properties)
[sourcecode language='java']
jdbc.username=some_user
jdbc.password=secret[/sourcecode]If you are using in the same project Velocity and want to utilize the VTL macros inside the configured values, the approach above will not work, because PropertyPlaceholderConfigurer will try to replace ALL macros in form ${something} with a value from property file - and throw exception if not found.The solution is easy: you need to switch the prefix of the PropertyPlaceholderConfigurer to something else than the default ${ and avoid conflict wih Velocity. The modified configuration could look like:

[sourcecode language='xml']
 

WEB-INF/mail.properties
WEB-INF/jdbc.properties

 

 
[/sourcecode]