tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Haines <shai...@ipnetsolutions.com>
Subject RE: Data File Directory
Date Fri, 16 Jun 2000 17:56:44 GMT
I am facing the same problem and I found that the current working directory
for my servlet (System.getProperty( "user.dir" ) ) is:

D:\Jakarta\jakarta-tomcat\bin

Is there a way to get the application's document base directory, as defined
in the server.xml file:

<Context path="/myapp" docBase="webapps/myapp" debug="0" reloadable="true" >

</Context>

So in my example: 

D:\Jakarta\jakarta-tomcat\webapps\myapp


Thanks in advance!
Steve


-----Original Message-----
From: Ken Baltz [mailto:KBaltz@responsenetworks.com]
Sent: Friday, June 16, 2000 8:41 AM
To: 'tomcat-user@jakarta.apache.org'
Subject: RE: Data File Directory


I believe the relative path to these files is relative to the doc root you
specify in the Context of your web app in server.xml.  Craig C. has
recommended putting these files in WEB-INF or a directory under it because
files there are guaranteed not to be served up by Tomcat.  That way you can
control access to these files.  

K.C. 

>  -----Original Message-----
> From: 	Jim Urban [mailto:jim.urban@netsteps.net] 
> Sent:	Friday, June 16, 2000 1:39 PM
> To:	tomcat-user@jakarta.apache.org
> Subject:	Data File Directory
> 
> I have a couple of data files my Servlet application needs to 
> access.  These are simple "flat" files I will access with the 
> Java "File" object.  What is the recommend directory I should 
> place these file in?  What should the file name look like in 
> the "File" constructor (xxx.dat, ./xxx.dat, /data/xxx.dat, etc).  
> 
> Thanks,
> 
> Jim Urban << File: ATT08409.txt >> 

--------------------------------------------------------------------------
To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
For additional commmands, email: tomcat-user-help@jakarta.apache.org

Mime
View raw message