Yes, i understand this.  The whole tomcat/common/lib directory.
This is why my example does not use Class.forName
That would take the classloader that was used to to start the
application in the first place, not the web application's classloader.

However, using

        Thread.currentThread().getContextClassLoader()

guarantees we'll get the current thread's classloader, which
inside of a servlet container is going to the web application's
classloader.

-----Original Message-----
From: robert burrell donkin
[mailto:[EMAIL PROTECTED]
Sent: Thursday, May 27, 2004 5:30 PM
To: Jakarta Commons Developers List
Subject: Re: [logging] ServletContextLogger


On 27 May 2004, at 15:29, Inger, Matthew wrote:

> Some points:
>
> 1.  The classloader for any thread in a servlet container is guarnteed 
> to
>     be unique per Web Application (context).  Each Web Application has 
> it's
>     own classloader, which is part of the servlet spec.  I'm not sure i
> understand
>     what your saying here.

it's not quite as simple as that :)

each class has a classloader. the class classloader is the loader that 
loads the class. the classloader is not necessarily the same as the 
context classloader attached to the thread in a container environment. 
for example, the class classloader is the root classloader if the class 
is on the root classpath. therefore, for some classes, the class 
classloader may be shared between web applications. the context 
classloader is unique (between web applications).

- robert


---------------------------------------------------------------------
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]

Reply via email to