2013/1/25 Justin Rosenberg <[email protected]>:
> Is there a to load a properties file that is dropped in the
> ${catalina.base}/lib directory?
>
>
>
> When I try the following it returns null:
>
> MyClass.class.getResourceAsStream(PROPERTY_FILE_NAME)
You should beware of the difference between Class.getResource() and
ClassLoader.getResource().
>
> I realize I can do the following, but I don't want the code to be server
> specific:
>
> props.load(new File(System.getProperty("catalina.base") + "/lib/" +
> PROPERTY_FILE_NAME).toURL().openStream());
>
You can make the path configurable with an init-param in your context.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]