Thanks for the reply.
So, for a scalability, you suggest that I should change TextProvider 
implementation to load a resource bundle for each customer. I don't exactly 
know how to tell it to load a customer specific resource bundle. I mean which 
methods to override for doing this. And also how to associate this custom 
TextProvider to my BaseActionSupport class.

Thanks
Pranav

----- Original Message ----
From: Jeromy Evans <[EMAIL PROTECTED]>
To: Struts Users Mailing List <user@struts.apache.org>
Sent: Sunday, April 20, 2008 9:07:52 PM
Subject: Re: Intenationalization questions

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]






      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to