-----------------------------
Please read the FAQ!
<http://java.apache.org/faq/>
-----------------------------

Thanks John,
        tried that, java creates the file in your user.dir which isn't much use.
There are good arguments as to why I shouldn't be able to find out this
information but I think my need outweighs them.
I think some of the JServ config info should be at least readable using a
static method.
Unless of course there's some sneaky easy way of finding out.

Paul.



-----Original Message-----
From: [EMAIL PROTECTED] On Behalf Of John
Reynolds
Subject: Re: environment information

Paul,

Try something like the below to get the path of the servlet class.

 File path = new File(".");
 String dir = path.getAbsolutePath();
 System.out.println("path is: " + dir);

John

Paul Murphy wrote:

> -----------------------------
> Please read the FAQ!
> <http://java.apache.org/faq/>
> -----------------------------
>
> I am trying to find out the real path for where my servlet is running
from.
> I am trying to do this in the init() method before I have access to a
> HttpServletRequest object. I could work it out from the real path of where
> JServ is located but there doesn't seem to be any static methods or
members
> to tell me where the JServ installation is.
> I am using a properties file during initialisation but I have to hard code
> the path right now. This makes it difficult to move the code between
> development, testing and production.
>
> Any ideas?
>
> Thanks,
> Paul.
>
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]

--
============================================================================
==
        Beta may be a state of mind
        But Alpha is the state of being
        me - but inspired be ./ sig
============================================================================
==





--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to