Pranav wrote:
Hi,
Now my questions are:
1) If I do the above, do I always have to use the getText way of looking up the
messages? If I use the key attribute of the UI tags, will the overridden
getText methods be still called?
Yes. The Struts2 tags with a key attribute and the s:text tag call the
get getText(...) methods of the first TextProvider encountered in the
stack. This is usually your action if you extended ActionSupport. Note
that if you use the i18n tag it won't work as that tag creates an
alternative TextProvider in front of your action.
2) Also is there any major problem with the approach above to solve the
particular prolem I am having?
It seems appropriate for a small number of customers. Create a custom
TextProvider and delegate to it from your new base class, providing the
customer-specific key.
If this needs to scale out to a large number of customers, change your
TextProvider implementation to load a resource bundle for each customer
and a default resource bundle (ie. don't use customer specific keys; use
customer-specific bundles that take precedence over the default
values). Eventually you'll also be able to switch to database-backed
resource bundles to add custom customers dynamically if the need arises.
Hope that helps,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]