🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8711

Re: How can a class figure out directory path to where it was installed ?

#8711
From: Paul Furbacher [TeamB]
Date: Thu, 08 Mar 2001 19:01
22 lines
2012 bytes
Alex Colic wrote:

> I am trying to create a servlet that will allow users to modify their
> web.xml file. I know the class is going to be installed in the lib directory
> of the web-inf directory. I am trying to create a file object with the path
> to this directory.
> How do I construct a file object pointing to the directory from which the
> class is located. I can then work by way up a directory and then to the
> web.xml file.

Why not make it simpler by asking the container (the web/app server) 
for the Web-inf folder path?  Or, if your Web/app server doesn't 
have that info available through some API, you could take the 
approach of setting a System property on the command-line which
starts up the Web/app server's VM.  

  java -DxmlPath=c:/appserver/.../Web-inf  ....



Paul Furbacher (TeamB)
 - Please send responses to newsgroups only.  Thank you.
Technical Details
Message-ID: <3AA7D720.2E0E032@mac.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!feed2.onemain.com!feed1.onemain.com!feeder.qis.net!ptdnetP!newsgate.ptd.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!bornews.borland.com!dnews!24.9.87.144
References: <985iso$fjj4@bornews.inprise.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,e64ea888500608a1
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-03-08 11:18:06 PST
Message-ID: <3AA7D720.2E0E032@mac.com>
Date: Thu, 08 Mar 2001 14:01:52 -0500
From: "Paul Furbacher [TeamB]" <pfurbacher@mac.com>
Reply-To: pfurbacher@mac.com
Organization: Reverse Alchemy, Inc.
X-Mailer: Mozilla 4.7C-CCK-MCD {C-UDP; EBM-APPLE} (Macintosh; I; PPC)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: How can a class figure out directory path to where it was installed 
 ?
References: <985iso$fjj4@bornews.inprise.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.9.87.144
X-Trace: 8 Mar 2001 11:01:16 -0800, 24.9.87.144
Lines: 22
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!feed2.onemain.com!feed1.onemain.com!feeder.qis.net!ptdnetP!newsgate.ptd.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!bornews.borland.com!dnews!24.9.87.144