Bug 11688 - <i18n:message> cannot find <i18n:bundle>-tag
Summary: <i18n:message> cannot find <i18n:bundle>-tag
Status: CLOSED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: I18N Taglib (show other bugs)
Version: 1.0
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-14 11:13 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-14 11:13:13 UTC
MessageTag.getBundle() uses findAncestorWithClass() to get hold of a BundleTag. But as a 
MessageTag does not have a parent-tag, null is returned. getBundle() proceeds and fetches the 
bundle out of the pageContext, if possible.

Normally, this is no problem, but consider this 
situation:

file1.jsp:
<i18n:bundle baseName="bundle.one" 
scope="session"/>

file2.jsp, participating in that session:
<i18n:bundle 
baseName="bundle.two"/>
<i18n:message key="key.from.bundle.two"/>

The MessageTag 
here cannot find bundle.two, because
a) getBundle() returns bundle.one from the 
pageContext
b) bundle.two was not placed there by BundleTag because bundle.one was already 
there (see BundleTag.doEndTag())

so we get a NullPointerException.
Comment 1 Glenn Nielsen 2002-12-17 03:09:37 UTC
Fixed bug where bundle woult not get saved if any bundle existed in
any scope.  Should be available in next nightly build.