Use
  URL url = ServletContext.getResource(path)

Where path is relative to the web root. Then you can open the URL and see the last modified date and reload if it changed with ServletContext.getResourceAsStream(path) (or by opening the URL)

-TIm

Chris Ward wrote:


Thanks Filip,

I figured something was going on to stop it loading on subsequent
attempts - most of my testing was on non-servlet classes - but I want to have one
point
of entry for getting properties (my util is a singleton).  The servlets
trip
it up.

I just want to be able to pick up the .properties file from the same dir
as the
calling/client class - the reason I used the method below was because it
looks
in the class dir of the class instance passed in.

Is there a "best" way to identify the file path from the class passed
in?
I guess I could create it from the class.getName() and replace the "."
with
"\" but that seems ugly.

Anyone got any suggestions?

Is there a good package for doing this properties loading already?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to