getServletContext().getRealPath("/") will give you the fully qualified path
to the root of your application.

Kevin Jones
DevelopMentor
www.develop.com

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Nabil
> A. Malik
> Sent: 02 February 2001 20:26
> To: [EMAIL PROTECTED]
> Subject:
>
>
> Hi all,
>
> Have a question. How can my servlet know that path of my servlets
> directory, when the servlet executes by the servlet engine. Is there a
> way that the servlet engine has can give the path to the servlet before it
> executes it?
>
> I wrote a servlet but I also need to have an InputFileStream in it to
> get some data. But as the servlet engine executes the servlet, I cannot
> give the path as parameter while the servlet is being
> executed. I don't
> want to hard code the path of the servlet directory in my code.
> Is there a
> way that the servlet engine has can give the path to the servlet before it
> executes it(as parameter etc.)?
>
> Thanks.
>
> Nabil A. Malik
> email:  [EMAIL PROTECTED]
>         [EMAIL PROTECTED]
> URL:<http://www.jlab.org/~nabil/>
>
> __________________________________________________________________
> _________
> 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

___________________________________________________________________________
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