You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "A.L." <am...@yahoo.com> on 2001/08/21 21:58:08 UTC

Servlet Reads from file. how to specify path

I have a servlet which needs to read from a file to
get the database connection information.  I've tried
everything and can't seem to get the servlet to
properly read the file.

My question is how must paths be specified.  I am
running on windoes 200.  The directory of my servlet
is :

C:\work\jt\tomcat\webapps\jd\WEB-INF\classes
the file I am trying to read from is 
C:\work\jt\tomcat\webapps\jd\WEB-INF\classes\db.dat

My code for reading the file reads:
 Properties p = new Properties();
 p.load(new FileInputStream(Path Goes here));


Whenever i enter the path, I either get a null pointer
exemption, or if I simply enter a file name, p doesn't
load any information although the file contains text.


Thanks,


-Amos





__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/