How can a message which embeds dynamic information be generalized?...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   dude_jsp
Posted On:   Monday, February 12, 2001 02:12 PM

How can a message which embeds dynamic information be generalized? For example, how can we use ResourceBundle to give the output "Thank you for your interest. Your order number is ########. Please use this order number for future enquiries" where the ###### part is determined at runtime?

How can a message which embeds dynamic information be generalized?...

Posted By:   Anonymous  
Posted On:   Saturday, March 31, 2001 11:00 AM

You will need to use a ResourceBundle in cooperation with a MessageFormat. The API documentation includes a description of how it works. There is also a reasonable demo and explanation of how to use these classes together in The Java Tutorial at Dealing with Compound Messages.


In your case, you would use a one element Object array with the format pattern, changing the element to the appropriate order number as needed.

About | Sitemap | Contact