We have a custom TextProvider that implements getTexts by calling
ResourceBundle.getBundle(...) 
with a ResourceBundle.Control object in order to load the data from a
database.  However if we try 
to configure our bundles in the list of defaults
(struts2.custom.i18n.resources), then they never get 
read.
 
Seems that the issue is LocalizedTextUtil.findDefaultText calls
LocalizedTextUtil.findResourceBundle 
as opposed to the TextProvider interface.  The default implementation of
TextProvider (TextProviderSupport) 
then calls into LocalizedTextUtil.findResourceBundle.  We could do
something like that if we don't
find the RB in our our list.
 
Is this a bug?  I think that part of the issue is that the Struts2 and
xwork messages (the framework
defaults) need to be read in your way but our defaults need to be read
in another way.  "Defaults"
really isn't our defaults - its the frameworks.
 
Ways around this seems to be:
 
1. name our bundles to match the candidate bundles that get looked up by
Class-based TextProviders
2. always put an <s:i18n> tag around our <s:text> tags (always use
ResourceBundle-based TextProviders)
 
This is Struts 2.0.11.2 / Xwork 2.0.5 - we've already had to patch alot
in order to get this to work with
custom TextProviders.
 
Bug? Other work-arounds to try?
 
Brian

This e-mail message is being sent solely for use by the intended recipient(s) 
and may contain confidential information.  Any unauthorized review, use, 
disclosure or distribution is prohibited.  If you are not the intended 
recipient, please contact the sender by phone or reply by e-mail, delete the 
original message and destroy all copies. Thank you.

Reply via email to