Proposal for Resources Package

(0) Rationale

Many Java applications must support internationalization (i18n) of message strings presented as part of the user interface, or in messages written to log files. The standard Java APIs offer the java.util.ResourceBundle family of classes to support this requirement; however, these classes have the following limitations that reduce their usefulness:

The classes in the proposed Resources package offer solutions to these two problems, and provide a framework for providing customized MessageResources implementations that can access resource strings from any desired static or dynamically updated collection.

(1) Scope of the Package

The proposal defines a miniature resources framework consisting of two abstract classes:

An initial (and default) implementation accesses the required message strings from Properties files accessed via Class.getResource(). These files are named with a base name, plus extensions identifying the Locale of the contained message strings, in a manner identical to the java.util.PropertyResourceBundle class of the standard APIs.

(1.5) Interaction With Other Packages

Resource relies on the standard JDK 1.2 (or later) APIs, plus the Collections package from Apache Commons.

No external configuration files are utilized.

(2) Initial Source of the Package

The four original Java classes (MessageResources, MessageResourcesFactory, PropertyMessageResources, and PropertyMessageResourcesFactory) are an integral part of the Struts Framework. However, they have no dependencies on other aspects of Struts. Once accepted and released as a Apache Commons component, Struts will be modified to use the Commons version of these classes, and its internal versions will be deprecated.

The proposed package name for the new component is org.apache.commons.resources.

(3) Required Jakarta-Commons Resources

(4) Initial Committers

The initial committers on the Resources component shall be Craig McClanahan, Michael Schachter, Jason van Zyl, and Daniel Rall.