Dave Newton wrote:
--- Paranoid_Fabio <[EMAIL PROTECTED]> wrote:
Hello. I've a problem with i18n resource bundles.
I've a page "home.jsp" that uses a resoruce bundle "res1"
for internationalization.
home.jsp, like all the pages of my web app, includes "bar.jsp" which is a
bar with some links. The links are also internationalized and this bar uses
the resource bundle "res2".
The problem is that, when I include the bar in the page, all the text
messages from res1 are not showed. If I do not include the bar, everything
is ok. It's like the first resource bundle overrides the second.
I use resource bundles in this way:
<s:i18n name="text/res1">
<s:text name="message"/>
</s:i18n>
Any help? Thanks!
Is the JSP included within an outer <s:i18n...> tag?
Caveat for following hypothesis: I haven't looked at this code for quite some
time now; a second opinion would be a really good idea.
I ask because the <s:i18n...> tag pushes the resources onto the stack. IIRC
things that look up messages stop looking when the first TextProvider is
found, meaning that if a resource isn't found in the first TextProvider it
will fail to find resources contained in underlying (further down the stack)
TextProviders.
The <s:i18n...> tag also pops blindly [1] on its closing tag, which can lead
to issues if there are any nested, unbalanced pushes.
Right, an s:set, s:push, s:action within the i18n tag will prevent it
from popping correctly..
It might be helpful to provide a skeleton outline of how things are being
done on your page.
Yeah, you haven't indicated how res1 and res2 are each being loaded.
Dave
[1] It now throws an exception or logs (I forget which) when it pops
something "unexpected".
It now (2.1) throws an exception if the object popped is not the
TextProvider that was pushed. The tag keeps a reference to the
TextProvider instance it pushed.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]