Properties properties = new Properties();
ClassPathResource classPathResource = new ClassPathResource("xxx/xxxxx.properties"); //配置文件的相对路径
try {
properties.load(new InputStreamReader(classPathResource.getInputStream(), "gbk"));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
properties.getProperty("url")//获取到key对应的value