Consider this <constant name="struts.custom.i18n.resources"
        value="messages/default,messages/customize" />
And default.properties content islabel.sample = Default Sample
And the customize.properties content is//Duplicate key
label.sample = Customize Sample
Calling <s:text name="label.sample"> will result in Customize Sample If we 
review the above strust i18n this seems correct behavior as we first defined 
default and then the customize, so the keys in customize properties will 
override the keys in default.Now we try to override the customize messages 
dynamically. So    <!--The customize is removed -->
    <constant name="struts.custom.i18n.resources"
            value="messages/default" />
In some where like an startup servlet, we add customize messages 
as:LocalizedTextUtil.clearDefaultResourceBundles();
LocalizedTextUtil.addDefaultResourceBundle("messages/customize");
This will not work! As alternative if we remove default from i18n property and 
do it as below, we will get the customize 
valueLocalizedTextUtil.clearDefaultResourceBundles();
LocalizedTextUtil.addDefaultResourceBundle("messages/default");
LocalizedTextUtil.addDefaultResourceBundle("messages/customize");
Is it possible to keep the list of default properties in xml and only add 
customize ones at run time  ~Regards,
~~Alireza Fattahi

Reply via email to