Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: default directory for files in tomcat

Bruno Melloni

2004-01-22


I assume you mean web application, not applet.

An alternative is for the webapp to read the file from "somewhere on the classpath". I have not tried it and don't know the exact technique, but you should be able to find how to do it. Then you could put your file in web-inf/classes in your .war file.

-----Original Message-----
From: ext Shapira, Yoav [mailto:Yoav.Shapira@(protected)]
Sent: Thursday, January 22, 2004 7:52 AM
To: Tomcat Users List
Subject: RE: default directory for files in tomcat



Howdy,
The "default" location for files is the "current working directory"
which is the directory from which the startup script is launched.
Needless to say, relying on this is fragile at best. So you want to
write your applet such that the location of the .ini file is a
parameter, and pass your applet this parameter (preferably a URL
obtained via ServletContext#getResource as opposed to a file IO
mechanism).

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Allan Bruce [mailto:allanmb@(protected)]
>Sent: Thursday, January 22, 2004 8:08 AM
>To: tomcat-user@(protected)
>Subject: default directory for files in tomcat
>
>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.
>Thanks
>Allan
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
>For additional commands, e-mail: tomcat-user-help@(protected)




This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.