You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bauert Daniel <Da...@timeware.ch> on 2001/06/13 08:40:24 UTC
get keys from MessageResources
hi all,
I'm a neu STRUTS 1.03b user. I would like to get all keys from the
MessageResources object. I used the struts version 0.53 and got the keys as
follows
MessageResources resources = null;
try {
resources = MessageResources.getMessageResources("MyResources");
} catch (MissingResourceException e) {
}
ResourceBundle bundle = resources.getBundle(locale);
Hashtable hashtable = new Hashtable();
Enumeration bundleKeys = bundle.getKeys();
while (bundleKeys.hasMoreElements()) {
String key = (String)bundleKeys.nextElement();
String value = bundle.getString(key);
hashtable.put(key, value);
}
How can I do this with STRUTS 1.0-b3.
Thanks,
Daniel.