Ok maybe there is a lot of work for this issue. It isn't a problem when using
wicket ComponentStringResourceLoader is just a problem if we need to access
the database all the time for a string and clear the entier cache if the
database is updated.

when looking at  the source for Localizer#getCachedKey it returns the whole
path, with style and locale. If I implemented a clearCachedKey like this. (
just on top of my head )

/**
 * Clear a key from the cache. 
* 
*/
public void clearCachedKey( final String key, final Component component ){
  if( cache == null ) return;
  String cachedKey = getCacheKey( key, component );
  if( cachedKey != null ){
    cache.remove( cachedKey );
  }
}

wouldn't that be sufficient. The entire locale, style is taken care of by
the getCachedKey. If the component is null only the key is returned.
-- 
View this message in context: 
http://www.nabble.com/Localizing-thru-database-lookup-tp24627686p24635300.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to