struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Baranski" <>
Subject RE: ResourceBundle with DB backend
Date Fri, 28 Aug 2009 19:49:55 GMT

>-----Original Message-----
>From: Tommy Pham []
>Sent: Friday, August 28, 2009 12:44 PM
>To: Struts Users Mailing List
>Subject: Re: ResourceBundle with DB backend
>----- Original Message ----
>> From: Mike Baranski <>
>> To: Struts Users Mailing List <>
>> Sent: Friday, August 28, 2009 9:22:06 AM
>> Subject: RE: ResourceBundle with DB backend
>> I've done it, you just implement the proper classes and tell your
>> application to use them instead.  I use a derby back-end.  I can post
>> tutorial later if you'd like.
>> >-----Original Message-----
>> >From: Tommy Pham []
>> >Sent: Friday, August 28, 2009 12:17 PM
>> >To:
>> >Subject: ResourceBundle with DB backend
>> >
>> >
>> >Hi,
>> >
>> >After reading through Localization and Formatting Date and Numbers,
>> >unable to find any information regarding using DB backend for
>> >ResourceBundle (by Struts specifically).  Suppose I have the proper
>> >structure to provide the proper format & results as needed, how would
>> >go about getting Struts 2.1.6 to use it instead of checking the
>> >properties files through out the directory/folder hierarchy?  If I'm
>> >using Servlets+JSP, a custom class wouldn't be a problem.  I know
>> >possible on ASP.NET since I've read about it on MSDN.
>> >
>> >TIA,
>> >Tommy
>> >
>> >
>> >---------------------------------------------------------------------
>> >To unsubscribe, e-mail:
>> >For additional commands, e-mail:
>Hi Mike,
>Thanks for the reply.  Yes, please post the tutorial when you're
>available.  I was thinking about that too which should work fine for
>normal texts.  But how do you overcome the validation when the texts are
>in external <class>-validation.xml?  I was hoping to implement something
>that would tell struts to use my custom class instead of the default
>ResourceBundle.  So later if I decide not implement the database
>backend, there's no need to rewrite all those getTexts :D

Tommy, here's the gist of what I did:

*Implement a custom ResourceBundle that loads text from derby (or whatever
*Implement a base class that extends ActionSupport, that all my actions
*In the constructor, get the custom ResourceBundle
*Override the getText(...) methods from my base class, and use the custom

Hope that helps, I can post the code somewhere, too, if needed.

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

View raw message