Public class propertiesutils {/*** log record class */Private Static final log logger = logfactory. getlog (propertiesutils. class); Private Static Properties Config = NULL; static {inputstream in = propertiesutils. class. getclassloader (). getresourceasstream ("mm_config.properties"); Config = new properties (); try {config. load (in); In. close ();} catch (ioexception e) {logger. error (E); system. out. println ("") ;}}/*** read all properties information ** @ see [Class, Class # method, class # member] */public static void readallproperties () {try {enumeration en = config. propertynames (); While (en. hasmoreelements () {string key = (string) en. nextelement (); string property = config. getproperty (key); system. out. println (Key + property) ;}} catch (exception e) {e. printstacktrace (); logger. error ("configinfoerror" + E. tostring ());}} /*** read value based on the key ** @ Param key * @ return * @ see [Class, Class # method, class # member] */public static string readvalue (string key) {// properties props = new properties (); try {string value = config. getproperty (key); return value;} catch (exception e) {e. printstacktrace (); logger. error ("configinfoerror" + E. tostring (); return NULL ;}}}