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

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]

Reply via email to