RE: Loading resources from classpath in components

2006-05-31 Thread James Carman
I think you're right.  The ClassLoader that's assigned to the class
generated by Javassist might not support that method.  Print out the type of
the classloader to make sure.

-Original Message-
From: Dan Adams [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 31, 2006 3:39 PM
To: Tapestry users
Subject: Loading resources from classpath in components

How do you load resources from classpath within a component? If I do:

this.getClass().getClassLoader().getResourcesAsStream(path);

then it returns null but if I do:

writer.getClass().getClassLoader().getResourcesAsStream(path);

then it returns the resource fine. I'm guesssing it has to do with
writer (which is an IMarkupWriter) not being an enhanced class. What is
it about the tapestry classloading that causes it not to work as
expected?

-- 
Dan Adams
Software Engineer
Interactive Factory
617.235.5857


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



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



RE: Loading resources from classpath in components

2006-05-31 Thread James Carman
Could you try using the thread context classloader?

-Original Message-
From: Dan Adams [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 31, 2006 3:39 PM
To: Tapestry users
Subject: Loading resources from classpath in components

How do you load resources from classpath within a component? If I do:

this.getClass().getClassLoader().getResourcesAsStream(path);

then it returns null but if I do:

writer.getClass().getClassLoader().getResourcesAsStream(path);

then it returns the resource fine. I'm guesssing it has to do with
writer (which is an IMarkupWriter) not being an enhanced class. What is
it about the tapestry classloading that causes it not to work as
expected?

-- 
Dan Adams
Software Engineer
Interactive Factory
617.235.5857


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



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