It currently supports the following configuration file formats: Properties files XML documents Windows INI files Property list files (plist) jndi jdbc Datasource System properties Applet parameters Servlet parameters I am currently using the latest version 1.9, the following describes how to call a Properties file: 1. load the jar package. I use maven to automatically load it, pom. the xml configuration is as follows: [html] <dependency> <groupId> commons-configuration </groupId> <artifactId> commons-configuration </artifactId> <version> 1.9 </version> </dependency> <! -- Commons-configuration automatically loads version 2.1, and an error is reported during compilation, therefore, add the --> <dependency> <groupId> commons-lang </groupId> <artifactId> commons-lang </artifactId> <version> 2.6 </version> </dependency> The common-lang package must use the new version, if you do not write this dependency, commons-configuration will download an old 2.1 version, resulting in a compilation Error 2. java code: [java] PropertiesConfiguration config = new PropertiesConfiguration ("/database. properties "); String userName = config. getString ("name"); except getStrin In addition to the g () method, you can call methods of different return types, such as getBoolean, getDouble, and getInteger. Advanced usage: there are multiple configuration files in a project, so it is necessary to have a unified configuration file management class. I wrote a simple one for your reference, if you have any improper usage, please refer to 1. java class [java] package com. xxx. xxx. util; import java. util. hashMap; import java. util. map; import org. apache. commons. configuration. configurationException; import org. apache. commons. configuration. propertiesConfiguration;/***** <p> * read configuration file class * </p> * <p> * return attribute content based on the configuration file name and attribute key, configUtil. get (configFile, property); * </p> * @ author sheng Zhi. rensz **/public class configUtil {private static configUtil initor = new configUtil (); private static Map <String, Object> configMap = new HashMap <String, Object> (); private configUtil () {}/*** get content * @ param configFile * @ param property * @ return */public static String get (String configFile, String property) {if (! ConfigMap. containsKey (configFile) {initor. initConfig (configFile);} PropertiesConfiguration config = (PropertiesConfiguration) configMap. get (configFile); String value = config. getString (property); // todo log return value;}/*** load the configuration file. After initialization, add map * @ param configFile */private synchronized void initConfig (String configFile) {try {PropertiesConfiguration config = new PropertiesConfiguration (configFile); configMap. put (configFile, config);} catch (ConfigurationException e) {e. printStackTrace () ;}} 2. call method [java] configUtil. get ("/common/velocity. properties "," input. encoding ");