McClanahan-san wrote:

> Struts uses the standard Java ResourceBundle mechanisms to load the resource
> bundles it uses.  That means the underlying properties files should be found by
> the class loader used for your web application.
> 
> In particular, if your resource bundle is named
> "warrantClasses.warrantResources", Java will expect to find one of the
> following:
> 
> * A file in your WEB-INF/classes directory at
>   "WEB-INF/classes/warrantClasses/warrantResources.properties"
> 
> * A file "warrantClasses/warrantResources.properties" in a JAR
>   file under WEB-INF/lib.
> 
> * A file "warrantClasses/warrantResources.properties" somewhere
>   on the system classpath.

A higher priority than the above three would be:

* A file in your WEB-INF/classes directory at
  "WEB-INF/classes/warrentClasses/warrentResources.class"

Experience has shown that the Java ResourceBundle mechanism looks 
for .class files before .properties files.  I found this out the
hard way when I had a Logger.class interface file and a
logger.properties property file.  On UNIX, this was no problem,
but on Windoze I kept getting an error that logger.class was not
a ResourceBundle.  (Yes, the error message even used lower case,
although the class file started with an upper case "L".)  It took
me about an hour to figure this one out.

Then, you've also got your system's default Locale which also takes
presidence when looking for ResourceBundles.  So for me,
warrentResources_ja.properties would come before
warrentResources.properties.

I'm not sure how the Locale and class/properties order would go,
though.  I haven't experimented that far.

--
Michael Westbay
Work: Beacon-IT http://www.beacon-it.co.jp/
Home:           http://www.seaple.icc.ne.jp/~westbay
Commentary:     http://www.japanesebaseball.com/

Reply via email to