DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10897>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10897

PropertyMessageResources loading resources from the wrong ClassLoader





------- Additional Comments From [EMAIL PROTECTED]  2002-09-30 10:11 -------
So i think that it must be important that ResourceBundle can reload file. Why?
Because when i use <bean:message ... /> tag to internationalize my site, and i
make a modification in a propertie file, the modification isn't done in the site.

To reload ResourceBundle, there is no "clean" method. We must used reflection:

    Class klass =   
ResourceBundle.getBundle("mesProperties").getClass().getSuperclass();
    Field field = null;
    try {
      field = klass.getDeclaredField("cacheList");
    } catch (NoSuchFieldException noSuchFieldEx) {
      System.err.println(this.getClass().getName()+" : "
        +noSuchFieldEx.getMessage());
    }
    field.setAccessible(true);  // autoriser l'accès au cache
    SoftCache cache = null;
    try {
      cache = (SoftCache)field.get(null);
    } catch (IllegalAccessException illegalAccessEx) {
      System.err.println(this.getClass().getName()+" : "
        +illegalAccessEx.getMessage());
    }
    cache.clear();
    field.setAccessible(false);   // Ne pas oublier de refuser l'accès

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

Reply via email to