Jose Moreira wrote:
thanks :) i noticed that the servlet context isnt available also ...
but if i put the properties file inside the WEB-INF/lib, what's it's path ?
If the properties file is in WEB-INF/lib, then it must be in a JAR file. The technique for accessing a properties file from a JAR file is something like this (could be a little wrong):
String propertyPath = "jar:/path/to/jarfile.jar!/path/to/properties";
InputStream in =
this.getClassLoader().getResourceAsStream(propertyPath);
Properties p = new Properties();
p.load(in);The problem here is that this requires you to know the absolute path to the JAR file, which I do not know if it is possible for a webapp to give you the absolute path.
However, it must be possible because I believe log4j uses properties files from JAR files in webapps. So, you might want to ask around there or check the log4j source code. Please let us know what you find!
Erik
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
