nformosa wrote: > Hi All, > > I'm having trouble when deploying my WAR application. The War file contains > mainly the WEB.xml, and index.html file and a number of required libraries, > incudling the compiled src code i've written, All libraries are stored > within the WEB-INF/libs which is correct. Along the libraries i have a > folder called resources, which have a number of files used as properties > files. > > The problem is that when i'm trying to access these files (property files) > i'm givin a 'Not found' error, and mainly this is due to the fact that its > looking in the bin folder of tomcat as its classpath! > > I'm accesing these files using relative paths ie: /resources/config.xml > > How can i fix this problem? any ideas would really be appreciated! > > thanks in advance > Nick > What you are seeing with it referencing the bin directory is it accessing the directory tomcat was started from. Depending on the script, that can be virtually anywhere in the system.
The servlet API provides ServletContext.getResourceAsStream( webappRelPath ) for reading files in the webapp. If you placed the properties files in either WEB-INF/classes or a .jar file, you should also be able to do it with a Class.getResourceAsStream() method. --David --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]