Use (from http://www.docjar.com/html/api/com/opensymphony/xwork2/util/LocalizedTextUtil.java.html):
...
clearMap(ResourceBundle.class, null, "cacheList");
// if it's Tomcat
if ("org.apache.catalina.loader.WebappClassLoader".equals(cl.getName())) {
clearMap(cl, loader, "resourceEntries");
}
...
private static void clearMap(Class cl, Object obj, String name)
throws NoSuchFieldException, IllegalAccessException,
NoSuchMethodException, InvocationTargetException {
Field field = cl.getDeclaredField(name);
field.setAccessible(true);
Object cache = field.get(obj);
synchronized (cache) {
Class ccl = cache.getClass();
Method clearMethod = ccl.getMethod("clear");
clearMethod.invoke(cache);
}
}
Obviously, you can just import that library and use it if you want too.