tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@shareowner.com
Subject RE: Configure the location of a file to be opened by a java appli cation in Tomcat
Date Wed, 26 Feb 2003 19:50:22 GMT
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:cool_xml@yahoo.com] 
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" <chencl98@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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message