tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <>
Subject Re: default directory for files in tomcat
Date Thu, 22 Jan 2004 13:19:47 GMT
I don't see how an "applet" would have anything to do with where Tomcat 
starts up as they aren't even in the same JVM's.  Did you mean 
"servlet"?  Are you counting on being able to read files in a servlet via 
File IO?  Bad, bad, bad, bad, etc....   Never, ever, use File IO in a 
servlet application unless you are using paths provided explicitly via 
deployment configuration or using the servlet container's temp dir.  I 
would even try to avoid using the deployment config if at all 
possible.  Use URL's and Streams to load files using the classloader or the 
servlet context.

As far as your current issue, relatives paths are relative to wherever the 
JVM started from.  If you use the CATALINA_HOME/bin startup files, the VM 
base path will be set to that directory.  If you start it via a service and 
don't set the base directory for the VM, then it will start from whatever 
the default base directory is.  For instance on WinXP or Win2k, this would 
probably be C:\winnt\system32.


At 01:07 PM 1/22/2004 +0000, you wrote:
>I have an applet which requires a .ini file to be loaded up.  This file is
>only found if I am in the directory containing it when I startup tomcat.  Is
>there a default location for files, or is there a config for this?  I tried
>placing them in a few places but none worked unless I started tomcat from
>within that directory.
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message