>
>
> >
> > In tomcat 4.0b6 on Win2000 I'm using properties files that are in a jar
> > file in WEB-INF/lib.
> >
>
>This is equivalent to putting them unpacked under WEB-INF/classes.  The
>key issue is that the package naming hierarchy has to match the directory
>structure inside the JAR (just like with class names).
>
>Could you post a specific example of the ResourceBundle.getBundle() call
>you are making, and where you have placed the corresponding properties
>files?


Are you talking to me, (punk ;) ?

I think we're getting a little confused here... I'm not having any problems...

But for the record:

   public static String getString(String key, String sport, String pgcode, 
String lang) {
     String bundle = BASE_PACKAGE + sport.toLowerCase(engLocale) + "." + 
sport + pgcode + "rb";
     try {
       ResourceBundle rb = getResourceBundle(bundle, getLocale(lang));
       return rb.getString(key);
     }
     catch (MissingResourceException ignored) {
       if (DEBUG) {
         System.out.println("[ResourceLoader] failed to load " + key + " 
from " + bundle);
       }
       return getString(key, sport, lang); // call to the next loader in 
the chain
     }
   }



   private static ResourceBundle getResourceBundle(String bundle, Locale 
locale) {
     ResourceBundle result = ResourceBundle.getBundle(bundle, locale);
     if (DEBUG) {
       System.out.println("[ResourceLoader] bundle loaded:");
       System.out.println("                 bundle: " + bundle);
       System.out.println("                 locale: " + locale.getCountry() 
+ "_" + locale.getLanguage());
     }
     return result;
   }


I'm using a chain of packages, where the application first looks for the 
key in the package specific to the sport+page code, then the sport, and 
finally the global properties (e.g. BV008 --> BV --> <global>)




Jim



> >
> >
> > Jim
> >
>
>Craig McClanahan


--

                           *   Jim Cheesman   *
             Trabajo: 
[EMAIL PROTECTED] - (34)(91) 724 9200 x 2360
            If we do not succeed, 
we run the risk of failure.


Reply via email to