I have a list of key/value pairs of configuration values I want to store as Java property files, and later load and iterate through.
Questions:
in my opinion other ways are deprecated when we can do it very simple as below:
@PropertySource("classpath:application.properties")
public class SomeClass{
@Autowired
private Environment env;
public void readProperty() {
env.getProperty("language");
}
}
it is so simple but i think that's the best way!! Enjoy