Using Java properties files

Java properties files are a native Java mechanism for maintaining a set of persistent values, called "properties", across invocations of the JVM. They are typically files that are persistent to the local file system.

Properties files consist of one or more key/value pairs, very much like a Java Map structure.

How to do it...

The following code snippet demonstrates finding the value for the CommonDatabaseProblem key from the CommonUiLabels Java property file:

import org.ofbiz.base.util.UtilProperties;
errMsg = UtilProperties.getMessage("CommonUiLabels",
"CommonDatabaseProblem", messageMap, locale);

How it works...

OFBiz makes using Java properties files convenient and easy by loading them as resources on the Java CLASSPATH and providing several utility methods to access file contents.

See also

Please see the OFBiz UtilProperties API:

http://ci.apache.org/projects/ofbiz/site/javadocs/

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.140.204