On Wed, 01 Dec 2004 09:49:33 -0500, Wade Chandler <[EMAIL PROTECTED]> wrote:
> I never try to use relative paths in getResource. I always do this > getResource("/pippo.jar"); Also, I usually pick a class in my package > that I know will certainly be in my web-app classes folder or one of > it's jars. This way the classloader used for my call will know about my > objects and classes at it's level....so it doesn't make delegate > calls...and I use com.mydomain.mypackage.MyClass.class.getResource > instead of using the classloader call though that should not matter.... asking resources to classes or classloaders is the same thing: absolute paths for classes are relative paths for classloaders so the following lines are equivalent: com.mydomain.mypackage.MyClass.class.getResource("/xx.txt") com.mydomain.mypackage.MyClass.class.getClassLoader().getResource("xx.txt") I pick a class in my package too: if you pick another class you don't know which classloader you 're using (common/shared/ etc.) bye --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]