Presumably the Jakarta Taglibs developers and the Struts people are
going to centralize on the Commons-Resources package at some point in
the future, in which case the divergence will disappear?
On 11/11/2003 08:31 PM Kris Schneider wrote:
The JSTL algorithm will only use the root resource
No idea about that. The JSTL algorithm is defined in Chapter 8 of the JSTL spec
(1.0 1.1), so that's probably not changing in the near future. I haven't
looked at commons-resources too deeply so I can't comment on whether that will
help. The key concepts with JSTL seem to be an ordered list of
The JSTL algorithm will only use the root resource (your
ApplicationResources.properties) as a last resort. It will walk through the set
of locales returned by ServletRequest.getLocales and try to find a match. If it
can't, JSTL implements the concept of a fallback locale that it will attempt to
Try:
fmt:message key=${titleKey}/
Of course, you also need to make sure JSTL knows where your messages are stored.
You can set a default by including something like this in your web.xml:
context-param
param-namejavax.servlet.jsp.jstl.fmt.localizationContext/param-name
fmt:bundle basename=path.to.my.stuff.MessagesMyBundle
fmt:message key=my.message.to.display/
/fmt:bundle
Quoting Ben Anderson [EMAIL PROTECTED]:
As per earlier requests, I attempted to switch my bean:message tags to
fmt:message tags, however I have been unsuccessful thus far.
This is
I did this today and it was pretty simple. Check out
http://tinyurl.com/gkp1.
HTH,
Matt
-Original Message-
From: Ben Anderson [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 1:44 PM
To: [EMAIL PROTECTED]
Subject: fmt:message
As per earlier requests, I attempted to switch my
You can also call fmt:setBundle/ at the top of the page, and then use it
in each fmt:message../ via the bundle attr.
-Original Message-
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 10, 2003 3:51 PM
To: Struts Users Mailing List
Subject: Re: fmt:message
fmt:bundle
Your example works for setting JSTL's default localization context to use the
same resource bundle as Struts default message resource. In Ben's example, he's
using an alternate message resource which implies the need to change the
localization context.
One of the interesting things you can do
8 matches
Mail list logo