I've done it with a LookupMethods.properties file that contains the
following:
button.add=add
button.cancel=cancel
button.copy=copy
button.edit=edit
button.delete=delete
button.save=save
button.search=search
Then I have the following method in my BaseAction class:
/**
* Provides the mapping from resource key to method name
*
* @return Resource key / method name map
*/
public Map getKeyMethodMap() {
Map map = new HashMap();
ResourceBundle methods =
ResourceBundle.getBundle("org.appfuse.webapp.action.LookupMethods");
Enumeration keys = methods.getKeys();
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement();
map.put(key, methods.getString(key));
}
return map;
}
It's not much better, but it does make it a *bit* easier to manage.
HTH,
Matt
-----Original Message-----
From: Mick Knutson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 1:37 PM
To: struts
Subject: externalizing the button hashmap for the LookupDispatchAction?
I am just wondering if anyone has already made a nicer way to manage the
hashmap for the button labels on the LookupDispatchAction?
I hate having to continually add elements in the code when I add a new
button.
---
Thanks
Mick Knutson
coming soon:
Your SOS: Your personal emergency contact system.
http://YourSoS.com
+001(805) 563-0666 Office
+001 (708) 570-2772 Fax
---
---------------------------------------------------------------------
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]