tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A.L." <amoslie...@yahoo.com>
Subject Servlet Reads from file. how to specify path
Date Tue, 21 Aug 2001 19:58:08 GMT
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/

Mime
View raw message