You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "C. L. Chen" <ch...@yahoo.com> on 2003/02/26 19:43:19 UTC

Configure the location of a file to be opened by a java application in Tomcat

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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Configure the location of a file to be opened by a java application in Tomcat

Posted by Steve Guo <co...@yahoo.com>.
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" <ch...@yahoo.com> 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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, and more