Martin Gainty wrote:
> 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

I'm not asking about locales, I'm asking how you tell the <fmt:message />
tag which bundle to use when you have multiple default bundles as a result 
of having multiple modules. 

I currently have an application that has four modules, each with multiple 
resource bundles. I access the default resource bundles in each module:

<bean:message key="message.key" /> or,
<bean:message key="message.key" bundle="bundle.key" />

Struts stores the bundles in the application scope with the module name
appended to the Globals.MESSAGE_KEY constant, for example - 

org.apache.struts.action.MESSAGE/moduleOne

I'm writing a new app and I've decided to use JSTL instead of the non 
struts-el tags. Now I probably didn't make myself clear in my last post,
does Struts do something so that the <fmt:message /> tag works in a similar 
way, thus you can do:

<fmt:message key="message.key" bundle="${Globals.MESSAGE_KEY}" />

So that it doesn't matter what module you are in you'll get the right 
bundle...? 

Cheers,

-- 
Bob Arnott



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

Reply via email to