struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <p...@steitz.com>
Subject Re: Use messages from ApplicationResource.properties for an e-mail
Date Wed, 26 Mar 2003 05:05:22 GMT
Raible, Matt wrote:
> 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...
> 
> org.apache.struts.action.ActionMessage@13a4226
> 
> Thanks,
> 
> Matt
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message