tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher K. St. John" <...@distributopia.com>
Subject Re: Loading property files using ClassLoader.getSystemResource()
Date Wed, 13 Feb 2002 18:00:04 GMT
Bryan Austad wrote:
> 
> I use a class with static methods to load properties.  getResource() does
> not return a static URL, so I cannot use it within my static method.
> getSystemResource() returns a static URL.
> 

 static URL?

 Do you mean that getSystemResource() is a static method in
ClassLoader? That's true, but you're allowed to call non-static
methods on other objects inside a static method. In fact,
getSystemResource() just gets the system classloader with
getSystemClassLoader() and calls getResource() on it.

 Where are you calling the static methods from? From the init()
of a servlet? If so, you can get the servlet's classloader and
pass it to the static method.


-- 
Christopher St. John cks@distributopia.com
DistribuTopia http://www.distributopia.com

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message