-1

I'm creating a JavaModule with some utilities class.

This module will used from some different Java Applications (these projects will be have the dependency into their pom files).

Into my JavaModule I would like to use some properties files to store the settings values. I con't use Spring int this module.

What's the best practice to use the properties files into a JavaModule without using Spring annotations?

Is it the correct way as reported in this example?

What's the correct place where I have to put the properties files? Can I use a dedicated folder?

Is there a way to override a specific value that it's contained into my Java Module's properties file from a Java Application that use my module?

Safari
  • 11,437
  • 24
  • 91
  • 191

1 Answers1

0

I would use that logic, and afaik is the most common. But I was also in a project in which we used ResourceBundle even though it should be used to retrieve locale specific data, because it was less verbose. In that case was just:

ResourceBundle.getBundle("properties").getString("my.property");

Once again. The example from mkyong would be my first choice for anything but a POC.

fjsv
  • 705
  • 10
  • 23