Yes, it is true that it is cached.  No, it is not configurable.  That's
just the way it was designed.

To get around it without actually changing the distribution, you'll need
to add something like this to your implementation's getMessage(Locale
locale, String key) method:


public String getMessage(Locale locale, String key) {
  formats.clear();   // <- this clears the HashMap from super
  // the rest of your data access code
}


I know, it's a hack, but hey, it works for me.


--
James Mitchell
Software Engineer / Struts Evangelist
http://www.struts-atlanta.org
678.910.8017
AIM:jmitchtx




> -----Original Message-----
> From: Seyhan BASMACI (Internet Yazilimlari Yetkilisi) 
> [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 18, 2003 10:06 AM
> To: Struts Users Mailing List
> Cc: Leyla TOLUN (Internet Yazilimlari Yonetmeni)
> Subject: bean:message , reads only once the message from 
> MessageResource, is it caching messages for later use? 
> 
> 
> 
>       We are using DB based Messages, 
> 
> 
>       to do this we extended  MessageResources class such as 
> 
>       /*public class MyMessageResources extends 
> MessageResources implements Serializable { 
> 
>        public String getMessage(Locale locale, String key)   {
>                 DAO class that reads messages from DB only once 
>               }
>       */
> 
> 
>       im my page I am using bean:message to get page header message,
> 
>       /*
>       <bean:message key="header.mainpage"/>  */
> 
>       when the page accessed ,
>       for first time, it gets message calling  
> MyMessageResources.getMessage method,
> 
>       but for the following acceses , it doesn't get message 
> from MyMessageResources.getMessage , in debug mode , 
>       it enter only ONCE into MyMessageResources.getMessage 
> method , for the following acesses never enters into this method. 
>       I think it CACHES message for later use, is that true?
>       if so , how can cancel this  feature , because our DB 
> based message cache has reload feature , when the message 
> cache         reloaded , all beans must show refreshed data ,,
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to