tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bo Xu>
Subject Re: /lib & /WEB-INF/lib
Date Fri, 08 Jun 2001 13:32:40 GMT
eric ng wrote:

> Hi,
> In tomcat or other servlet engine implements the spec.
>  there are 2 place to put JAR files:
> 1) d:/tomcat/lib
> 2) d:/tomcat/webapps/abc/WEB-INF/lib
> I wonder what's the difference putting JAR in the 2
> directory? any performance difference? Should I always
> put JAR into web apps's own lib?
> thanks.
> [...]

Hi :-)

- the jar files in TOMCAT_HOME/sebapps/myapp/WEB-INFlib
  are loaded by the classloader of this webapp(myapp), normally they
  are only used in this webapp(myapp).

- the jar files in TOMCAT_HOME/lib are loaded by another classloader
   (SharedClassloader) which is "upper" than the classloader of this
   or that webapp in "JAVA2 delegation model", these jar files are
   for all webapp(0) or webapp(1) or webapp(2)...
      % If you want to share a utility class to all webapp, you can wrap

           it into a jar file, and put the jar file here.
      % because sometimes the classloader of one special webapp(for
           myapp) will be destroyed(for example, auto-reloading), so If
you don't
           want a utility class to be load/reload several times, you can
           it into a jar file, and put the jar file here.

June.08, 2001

View raw message