Or hard-coded your fully-qualified file name in web.xml
<init-param>
<param-name>mytextfile</param-name>
<param-value>my.text.file</param-value>
</init-param>
Then get file name using getInitParameter("mytextfile") in your Servlet.
Regards,
PQ
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"
-----Original Message-----
From: Steve Guo [mailto:[EMAIL PROTECTED]
Sent: February 26, 2003 2:26 PM
To: Tomcat Users List
Subject: Re: Configure the location of a file to be opened by a java
application in Tomcat
I think you can use context.getRealPath("/") to get root folder of current
webapp, then append your filename/relative path to this path. Never tried,
but think it works.
"C. L. Chen" <[EMAIL PROTECTED]> wrote:Hi,
I am trying to create a jsp which invokes a Java application connecting to
a database using JDBC. That Java application requires reading data from a
text file which contains information about the JDBC driver, user name and
password. The problem is I don't know how to direct Tomcat so that it can
find the text file needed by the JDBC connection. Does anyone know how to
configure Tomcat so that it will find the text file?
C. L. Chen
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more