In this Spring tutorial we look at how to externalize values from your Java application code ??
If this Spring Tutorial helps you and you would like the full source code and even better a free online video on this topic, so you actually watch the steps taken and follow along click here!
Remember Sharing is caring! So if you get something from this Spring tutorial please share it with others on facebook, google+, LinkedIn, Twitter etc… so it may help them too!
It’s not seen as good practice to have actual values hard-coded into you application code.
If you deploy your application into different environments, say from development to test to live, how can those values be changed ?
Values for things like;
- File paths,
- Server addresses etc…
- Usernames and Passwords.
All these and others need to be externalized from your actual Java application code. i.e. These values need to be external to your application code and pulled in at runtime from an external source. The reason is that many of the values mentioned and others may be dependent on the environment in which the application is deployed, e.g. test or live environments. Not to mention the security concerns about having usernames and passwords hard-coded in application code.
[click to continue…]