Create a directory named libinside the war (WEB-INF/lib) and copy the configuration (.properties) files into lib directory. At runtime JBoss will automatically load these files.
ViSolve JBoss Team.
String jbossHome = System.getProperties("jboss.home.dir"); Properties props = new Properties().load(new FileInputStream(jbossHome + "/" + propFileName ));
where propFileName is the name of your properties file.
Oops, change the file name in the last lin to read:
jbossHome + "/configs" + propFileName
Thanks for the information that works good!
I myself am new to writing web apps for running on JBoss. I have been writing apps on the ATG framework for the last few years.
What I am wondering is does JBoss support the concept of "components", basically you have a Java class and a .properties file for it.
You would have a java class for example:
and you have a properties file called MyClass1.properties that contains:
In the properties file the $class is what links the properties file to the class and the entries "property1" and "property2" line up with "getters/setters" in MyClass1. So when you "load" the class the data is automatically loaded by the "setters" in the class.
I hope this makes sense.
I know that the Spring Framework enables you to do that, though there you have a single configuration file where you specify the property values of all of your beans.