Rob Hazlewood wrote:
>
> I'm distributing a servlet, and the servlet needs to know where it is
> located.
>

 Why exactly do you want to know? There's probably a
work-around, but the solution would depend on what in
particular you're trying to accomplish.

 Although it won't help you a bit with your problem,
it might make you feel better to check out the official
java bug list. Some people feel strongly that env variable
access should be possible, or barring that, that the
documentation should be clarified.


> Ideally, I would like it to get it by setting an environment variable
> and then for the program to be able to read this.
> ... i've noticed that tomcat does it
>

 Tomcat cheats. The startup scripts do something along
the lines of:

  $JAVACMD $TOMCAT_OPTS -Dtomcat.home=${TOMCAT_HOME} org.apache.tomcat.startup.Tomcat 
"$@" &

 Of course, that's platform specific. You can check this
out on your own by looking in the "bin" directory of a
tomcat installation, where you will find a maze of twisty
little shell/bat scripts, all alike.



-cks

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to