Bug 11810 - <i18n:bundle> can't find bundles if not installed below WEB-INF
Summary: <i18n:bundle> can't find bundles if not installed below WEB-INF
Status: CLOSED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: I18N Taglib (show other bugs)
Version: 1.0
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-19 06:56 UTC by Wolfgang Schnerring
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Schnerring 2002-08-19 06:56:56 UTC
I wanted to use the i18n-taglib in several of my webapps, so I put the i18n.jar into 
TOMCAT_HOME/common/lib. The bundles of course reside below myWebapp/WEB-
INF/classes/path/to/package/*.properties.
But in this situation, the bundles can't be 
found and a MissingResourceException is thrown.

I suspect this problem lies a bit outside 
the responsibility of the BundleTag, or the Taglib in general, because BundleTag.findBundle() 
must rely on java.util.ResourceBundle.getBundle(), thus a ClassLoader and the CLASSPATH, in 
order to find the bundles.

This issue is easily solved by putting the i18n.jar into WEB-
INF/lib, or maybe alternatively by adding each WEB-INF/classes to the system CLASSPATH.

The 
documentation only talks about putting the jar to WEB-INF/lib, so no real fault here, but I think it 
would be nice to add something like "if you put it to common/lib, you'll have to adjust the system-
CLASSPATH or you'll run into trouble".
Comment 1 Glenn Nielsen 2002-12-17 03:23:23 UTC
Switched loading of bundles so that ResourceBundle uses the context ClassLoader
of the web application.  Should be fixed in the next nightly build.