Load Properties File Spring Config
If you are using Spring framework in your application and want to load complete properties file through class constructor through XML file configuration please use below code.
Note: Your properties file should be in classpath
- To better understand please have a look below maven project:
- As you see above we have DEV.properties file as below:
Test java class to load Spring context and read properties from file:
- For more information please visit Spring documentation here
Download Project: LoadProperitesFileXMLConfig