You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joseph Toth <JT...@lightspeedresearch.com> on 2004/06/08 22:54:58 UTC

Reload ApplicationResources

Looking for a way to reload ApplicationResources on the fly, WITHOUT
restarting the webapp.

I've been search for a while now and came up empty handed...

Simple, yet so hard.  The only thing I found is the following piece of
code which I cannot get to work.

 

Field field1 =

                        ResourceBundle

                                    .getBundle("ApplicationResources")

                                    .getClass()

                                    .getSuperclass()

                                    .getDeclaredField("cacheList");

            field1.setAccessible(true);

            sun.misc.SoftCache cache1 = (sun.misc.SoftCache)
field1.get(null);

            cache1.clear();

            field1.setAccessible(false);

 

            log.debug("ApplicationResources has been reloaded.");

 

 

Any ideas are appreciated.

Thanks