You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Julien Leonard <ju...@consulting-for.accor.com> on 2007/10/04 11:16:40 UTC

[S2] Access to ressource Bundle

Hello all,
 
In my Struts2 project, I use a custom ResourceBundle which takes i18n in a
database and cache them.
 
I have configured Struts to use it in struts.xml like this :
 
<constant name="struts.custom.i18n.resources"
value="com.xxx.xxx.i18n.StrutsResourceBundle"/>

And it works !
But I want to acces to the ressource bundle instance to be able to invalid
the cache.
Is there someone that have an idea on this ?


Julien 



This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
********************************************************************** 
Ce message electronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci apres "le message" ), sont confidentiels et destines exclusivement a l'usage de la  personne a laquelle ils sont adresses. Si vous avez recu ce message par erreur, merci  de le renvoyer a son emetteur et de le detruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressement autorisees de ce message, sont interdites.
********************************************************************** 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Access to ressource Bundle

Posted by Wes Wannemacher <we...@wantii.com>.
The class that is handling your ResourceBundle is -

http://www.opensymphony.com/xwork/api/com/opensymphony/xwork2/util/LocalizedTextUtil.html

'findResourceBundle(String aBundleName, Locale locale)' looks
promising, but I'm guessing it's not what your looking for.

It doesn't appear that there is a straightforward way to access the
'instance' of your resource bundle once it has been added. You could
make a JIRA and it would probably be an easy fix. There are other
possible ways to solve your problem in the interim, you could
invalidate the cache through a static method, or just about anything
else inventive you can think of.

-Wes

On 10/4/07, Julien Leonard <ju...@consulting-for.accor.com> wrote:
> Hello all,
>
> In my Struts2 project, I use a custom ResourceBundle which takes i18n in a
> database and cache them.
>
> I have configured Struts to use it in struts.xml like this :
>
> <constant name="struts.custom.i18n.resources"
> value="com.xxx.xxx.i18n.StrutsResourceBundle"/>
>
> And it works !
> But I want to acces to the ressource bundle instance to be able to invalid
> the cache.
> Is there someone that have an idea on this ?
>
>
> Julien
>
>
>
> This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
> **********************************************************************
> Ce message electronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci apres "le message" ), sont confidentiels et destines exclusivement a l'usage de la  personne a laquelle ils sont adresses. Si vous avez recu ce message par erreur, merci  de le renvoyer a son emetteur et de le detruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressement autorisees de ce message, sont interdites.
> **********************************************************************
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org