I am reading a properties file from the Tomcat\conf\somename.properties
directory using
String demo = System.getProperty("catalina.base") +
File.separator + "conf" + File.separator + "somename.properties";
This is working perfectly fine with Tomcat. But, there can be scenario where client may use any other server like Glassfish or Websphere, in that case I won't be able to get System.getProperty("catalina.base")
.
How should I solve it properly? I'm able to do that using ResourceBundle
but for that I have to keep my properties file in my build, which I don't want. I just want to read my properties file from outside my build.