As far as I know, there is no cross-server standard (i.e. its not in
the spec where the root is supposed to be). Consequently the best method is
one that will always work. The one that comes to my mind is to use the
ClassLoader.getResource and getResourceAsStream methods. Anything in the
classpath (even inside of JAR files) is accessible.
Randy
-----Original Message-----
From: Jonathan Asbell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 20, 2001 8:20 AM
To: [EMAIL PROTECTED]
Subject: *** Referring to a file or a directory from inside a jsp/servlet or
bean ???? ***
my web app directory structure is as follows:
webapps/myapp/..........
If I have a jsp and a bean in the root directory, and my bean refers to a
file without a full path(ie. just the file name, no absolute or relative
path), where does it loook for the ?
WAIT.........
This happens in jsp/servlets AND beans. With jsp servlets the default
directory should be the root directory of the app. The bean however seems
to look for a file with an unqualified path in the /tomcat/bin/directory.
I just want some rules of thumb to follow when I am using beans and
jsp/servlets that read and write files. How should I refer to these
external files. Where are their default directories in the context I
mentioned above?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]