获取 *.properties配置文件内容

package com.loan.modules.common.util;

import java.util.ResourceBundle;
/**
 * 获取 *.properties配置文件内容
 * @author Administrator
 *
 */
public class ObtainPropertiesInfo {
    /**
     * 
     */
    private static ResourceBundle ssoBundle = ResourceBundle.getBundle("CAS_SSO");
    /**
     * 通過 key 获取value值
     * @param key
     * @return
     */
    public static String getValByKey(String key) {
        String value = null;
        if(key != null && !"".equals(key.trim())) {
            value = ssoBundle.getString(key.trim());
        }
        return value;
    }
}

 

posted @ 2017-06-05 09:30  也许还年轻  阅读(189)  评论(0编辑  收藏  举报