I have a requirement to send a notification e-mail when an item in my app is deleted. I was hoping to use a string (post-substitution) from ApplicationResource.properties to do this, but alas, it does not work like I hoped. Is this possible without loading it as a ResourceBundle and calling getString()?
The struts MessageResources class encapsulates the ResourceBundle and will perform the substitution. Use:
MessageResources messages = MessageResources.getMessageResources("ApplicationResources");
String msgText = messages.getMessage("cr.deleted.msg", deletedBy, appURL);
// deletedBy and appURL are set previously as String variables
new ActionMessage("cr.deleted.msg", deletedBy, appURL).toString()
results in...
[EMAIL PROTECTED]
Thanks,
Matt
--------------------------------------------------------------------- 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]