On 6/13/06, Eric Rank <[EMAIL PROTECTED]> wrote:
I know that ApplicationResources and MessageResources do similar things, but I'm confused about how to understand their individual roles 1. What are the similarities and differences between MessageResources and ApplicationResources in a struts app?
Unless I'm not answering the right question... nothing. It's just the name of your resource bundle, you can name it whatever you want. It seems that in earlier Struts example apps, the file was called ApplicationResources.properties, and now it's MessageResources.properties.
2. What is the best way to specify that a struts app use these bundles? (web.xml, struts-config.xml, specify a bundle when using a jsp tag, etc.)
I've never done anything other than: (struts-config.xml) <!-- ========== Message Resources Definitions ============== --> <!-- This is the location of the ApplicationResources.properties file --> <message-resources parameter="ApplicationResources" null="false" /> (web.xml) <!-- For JSTL's fmt:message tag --> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> <param-value>ApplicationResources</param-value> </context-param> And you can see I'm using the "old" name... this app has been around for a few years. ;)
3. Bonus question: When internationalizing, do the extra xxx_[lng,locale].properties files need to be specified in the web.xml / struts-config.xml files for each additional language / locale?
No. You just specify the 'bundle name' and the right one will get selected based on the user's locale. -- Wendy --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]