1.代码
private static Properties properties = new Properties();
public static String getProperties(String key) {
PropertyPlaceholderHelper propertyPlaceholderHelper = new PropertyPlaceholderHelper(PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX, PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX);
if(properties.containsKey(key)){
return propertyPlaceholderHelper.replacePlaceholders(PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_PREFIX + key + PlaceholderConfigurerSupport.DEFAULT_PLACEHOLDER_SUFFIX, properties);
}else{
return "";
}
}