Hi,

I am new to struts 2 and trying to figure out a problem that I am having w.r.t. 
I18n. My application is supposed to serve multiple clients per hosted instance 
of the application and the requirement is to somehow support the requirement of 
display of client specific text for the same message resource key based on the 
logged in user. E.g. so if an end user is logging on to the system on behalf of 
customer 1 the same key "welcome.user" should display message different from 
what another end user of customer 2 sees for the same message resource key. 
Note that the locale is still the same i.e. US English. I was thinking about 
the following solution:

Solution: I will extend ActionSupport class and all its getText method such 
that each key will be prefixed by something unique to the customer like 
customer_id before the lookup and each messageresouce file will define the same 
key multiple times with the customer_id as prefix as needed. E.g. 
cust1.welcome.user, cust2.welcome.user etc. 

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?
2) Also is there any major problem with the approach above to solve the 
particular problem I am having?

Thanks and regards
Pranav




      
____________________________________________________________________________________
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