Bob-
assuming you set userLocale to english north america
<table bgcolor="#d0d0d0" cellspacing="0" cellpadding="5" border="0" width="100%">
<tr>
<td>
<center> <h2>
<fmt:setLocale value="<%=userLocale%>"/>
<fmt:bundle basename="com.abcbank.example.ApplicationResources">
 <fmt:message key="header.title"/>
</fmt:bundle>
</h2>
<br>
</td>
</tr>
</table>

so in the jsp if variable userLocale is set as Locale userLocale = new Locale("fr", "CA"); header.title key is located in ApplicationResources_fr_CA.properties located on the com/abcbank/example folder
and if header.title = Banque de Quebec
that is what you would see

Martin-

----- Original Message ----- From: "Bob Arnott" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <user@struts.apache.org>
Sent: Wednesday, May 25, 2005 1:20 PM
Subject: JSTL fmt:message with modules


Hello, just trying out JSTL on a new app I'm writing as I thought
it was about time I used it. However, I'm having a bit of trouble
with the <fmt:message /> tag as I don't know how to specify the
correct bundle to use.

I'm using modules and tiles, so each module has it's own resource
bundle, but they share the tiles templates. I'm trying to pass a
page title with a tiles definition and have it pulled from the
resource bundle and displayed. But I don't know how to tell the
<fmt:message /> tag which bundle to use...?

...
<title>
 <tiles:useAttribute id="title" name="title" scope="page" />
 <fmt:message key="${pageScope.title}" />
</title>
...

I've seen some web pages mention that you can put a context param
in the web.xml:

<context-param>
 <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
 <param-value>ApplicationResources</param-value>
</context-param>

But Shirley this wont work for modules...? Can anyone shed some
light on how I get this to work...?

Thanks,

--
Bob Arnott



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to