(1)application.properties
...
redis.ip=xxx.xxx.xxx.xxx
...
(2)工具类
import java.util.ResourceBundle;
public class SystemConfig {
static String configFile="application";
public static String getConfigInformation(String itemIndex){
try{
ResourceBundle resource = ResourceBundle.getBundle(configFile);
return resource.getString(itemIndex);
}catch (Exception e){
return "";
}
}
}