I think Bob asks a good question. 

1) Is setting the default bundle in JSTL for the entire web app? I think it
is. It seems the bundle must be explicitly set.

2) Perhaps Struts 1.3 could contain a chain plug-in that will set the
appropriate resource bundle for JSTL per module?

What do you think?

-----Original Message-----
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 25, 2005 4:29 PM
To: Struts Users Mailing List
Subject: Re: JSTL fmt:message with modules


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]





------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains 
information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New 
Jersey, USA 08889), and/or its affiliates (which may be known outside the 
United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as 
Banyu) that may be confidential, proprietary copyrighted and/or legally 
privileged. It is intended solely for the use of the individual or entity named 
on this message.  If you are not the intended recipient, and have received this 
message in error, please notify us immediately by reply e-mail and then delete 
it from your system.
------------------------------------------------------------------------------

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

Reply via email to