struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <>
Subject Re: i18n resources-file, problem isolated !
Date Fri, 23 Jun 2000 16:44:05 GMT
Marius Sorin Barduta wrote:

> > I don't know why, but it seems
> > the properties file will get loaded
> > from the same 'area' where the
> > class comes from, which does the ResourceBundle.getBundle
> > call.
> That is, AFAIK, because there are different Class Loaders for classpath and
> for each context.
> Am I right?
> Marius

That is correct.  Tomcat, and other servlet containers that implement 2.2, will
define a special class loader for each web application, which (among other
things) loads classes (and resources) from the WEB-INF/classes and WEB-INF/lib
directories for that web application.  If you are curious, you can look at the
Javadocs for "java.lang.ClassLoader" to see what a class loader has to be able
to do.

I can tell you from experience (my "day job" at Sun is working on Tomcat) that
getting resource loading in a class loader to work correctly is pretty
intricate.  I'm still investigating this problem area, but don't have a general
solution to offer yet.  One thing that makes this interesting to figure out is
that the current Struts code works fine for me on two platforms (Windows98+Sun
JDK 1.2.2_05 and RedHat 6.1 + Sun JDK 1.2.2-L), using either the standard
Tomcat 3.1 release or the most current stuff from the CVS repository.  It's
harder to debug problems when you can't reproduce them :-(.


View raw message