Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Externalizing configuration of a webapp?

I am trying to port to Jetty 7 - hightide.

We have a  webapp that has a configuration file that the webapp dynamically responds to, i.e. if the file is changed (edited) on disk,
the application picks up the changed configuration.

Thus, the configuration file needs to be outside the war file, somewhere on the disk where it can be edited. The way the application is packaged, a copy of the configuration file also exists inside one of the jars e.g. WEB-INF/lib/xyz.jar in the war. So, I need a capability where I can tell Jetty's classpath to include the location of configuration file on disk first and then other regular classpaths. 

I tried the -Djetty.class.path suggestion made at: http://docs.codehaus.org/display/JETTY/Classloading but somehow it does not take effect. I always end up loading the configuration file that is in WEB-INF/lib/xyz.jar

Thus, I am not able to make my application's configuration dynamically applicable.

(Inside the app, the configuration file is loaded using ClassLoader.getResourceAsStream()).

Thanks in advance,
Kedar

Back to the top