> MessageResources msgs =
(MessageResources)context.getAttribute(org.apache.struts.action.Action.MESSA
GES_KEY);
> This is deprecated however, but it works;
FYI, the un-deprecated version is
context.getAttribute(org.apache.struts.Globals.MESSAGES_KEY);
> I want to do the same by obtaining the resource bundle from JSTL but
> after searching everywhere I can't find the solution. Yes, I can
> retrieve a single translated key, but I want to parse the whole
> resourcebundle to our report engine. This tool must also work without
> running in a web environment, and then I provide it with a standard
> Java resource bundle.
Would this help? (sorry I'm not exactly sure what you're after)
LocalizationContext i18nContext = (LocalizationContext)
Config.get(context, Config.FMT_LOCALIZATION_CONTEXT);
ResourceBundle rb = i18nContext.getResourceBundle();
navalverma@yahoo.com - 29 Mar 2005 18:52 GMT
PropertyResourceBundle.getBundle(String baseName, Locale locale,
ClassLoader loader) also works.
You can not pass parameters to retrieve customized messages as in
MessageResource.