"Moth" <no*@this.address> wrote in message news:<ge******************@news-server.bigpond.net.au>...
I have a web application that needs to read an xml configuration file. How
can I specify this without knowing the path of the web application?
I've tried using ClassLoader.getSystemResourceAsStream(filename) but this
doesn't seem to work for my servlet even with the config file in the lib
folder of the web app.
Can anyone give me any pointers?
I do not know if you are using Tomcat, but if you are I think you
should try to put the file in the /WEB-INF/classes directory of your
application. In this directory you should put classes and resources
that are unpacked. Classes and resources in jar-files should be put in
the /WEB-INF/lib. Classes and resources that are put in these
directories are visible only to the containing web application, but to
no others.