struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Akins <>
Subject Re: Any way to load resources in java.util.ResourceBundle
Date Fri, 16 Jul 2010 11:57:58 GMT
I'm resurrecting this message because I have the same need.

I'm converting some code to Struts2, from a JSP/Servlet application.
Currently we create bundles from a database, that have keys per
customer and language for most of the text in our application.

A simple solution to this would be to override
LocalizedTextUtil.findDefaultText and add a call to our classes that
load the text into a ResourceBundle.

However it doesn't look like there is anyway, in Struts to use
my own version of LocalizedTextUtil.

Does anyone have any thoughts on how I might do this?

On Wed, Jan 27, 2010 at 12:43 PM, Bhaarat Sharma <bhaarat.s@xxxxxxxxx>wrote:

> We have seen situations where sometimes the global resource bundles are
> lost intermittently for some sessions. We are in a clustered/shared
> environment where multiple apps are deployed onto a GlassFishV2 server.
> Multiple apps share the struts2 core jars.
> We have some pages where we have written a custom Resource loader and
> everything looks fine on these pages. Problem is on pages that utilize
> <s:text name=""/>. Our properties files reside globally in
> WEB-INF/lib
> Our custom resource loader works as follows in a JSP
> <%CustomMessageResrouce cusResource = new
> CustomMessageResource("Resource")%>
> <%= cusResource.getMessage("")%>
> Java code for it looks like:
> import java.util.ResourceBundle;
> ResourceBundle resource = ResourceBundle.getBundle(baseName);
> So we know that loading properties into resourcebundles and using them as
> shown above works.
> My question is..can we do the same for struts2. Can we forcefully load the
> resourcebundles inside java.util.ResourceBundle and then have them be used
> in <s:text> tag?

Greg Akins

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message