Try to use ServletContext.getResourceAsStream().
The user.dir approach is the user dir of the user who has started the
engine.
----- Original Message -----
From: Gibson David <[EMAIL PROTECTED]>
Date: Tuesday, October 16, 2001 12:09 pm
Subject: Re: servlet to read a file
> I had a similar problem and managed to solve it by getting the system
> properties.
>
>
> Properties prop = System.getProperties();
> Enumeration eKeys = prop.getKeys();
> Enumeration eElements = prop.getElements();
>
> while(eKeys.hasMoreElements()) {
> System.out.println("key = " + eKeys.nextElement();
> System.out.println("property" = " + eElements.nextElement();
> }
>
> I was then able to find the user.dir property.
>
> This property is where the Java VM sets it default path to be.
>
> For myself this was the system32 directory under winnt.
>
> I then placed the file in there and it picked it up ok.
>
> Hope this helps
>
> David Gibson
>
>
________________________________________________________________________
___
> To unsubscribe, send email to [EMAIL PROTECTED] and include in
> the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http:
> Resources: http://java.sun.com/products/servlet/external-
> resources.htmlLISTSERV Help:
> http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
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