It’s never a good practice to hard code and combine any environment related details such a username, password or file path etc. along with spring bean configuration. Usually in Java we will be having those details written in a separate property file and it will be read during the execution, the same can be followed in the spring as well using PropertyPlaceholderConfigurer.
Spring comes with a bean factory post processor called PropertyPlaceholderConfigurer which allows you to externalize those details into a properties file. In this Spring PropertyPlaceholderConfigurer Example we will learn how to use the PropertyPlaceholderConfigurer. [Read more…]