Custom Tags + i18n
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aaron_Wallace
Posted On:   Friday, July 12, 2002 12:47 PM

I have developed some custom tags which encapsulate application logic. I also have some which allow for looking up i18n messages in properties files. My question is: How do I handle the case where I have i18n messages which are returned by my "logic" custom tags? e.g. I retrieve a list of first and last names from a DB, and want to speak each name in the context of a message, e.g. The name is . or The first name is . The last name is . I can see a couple of approaches here: 1. Look up the messages inside the tag code, using Properties/ResourceBundle - but this then involves a code change when I want to change a particular message   More>>

I have developed some custom tags which encapsulate application logic. I also have some which allow for looking up i18n messages in properties files. My question is: How do I handle the case where I have i18n messages which are returned by my "logic" custom tags? e.g. I retrieve a list of first and last names from a DB, and want to speak each name in the context of a message, e.g.


The name is .


or


The first name is . The last name is .



I can see a couple of approaches here:



1. Look up the messages inside the tag code, using Properties/ResourceBundle - but this then involves a code change when I want to change a particular message key, i.e. if I want to change the message in one place, but it is used in several other places where I want to leave it the same.



2. Pass message keys as attributes. This seems like it has the potential to get unwieldy.



Any ideas?

   <<Less
About | Sitemap | Contact