手动获取bean,手动获取配置文件中的数据

93 阅读1分钟

手动获取bean

(62条消息) SpringBoot手动获取Bean_奚学长又装死的博客-CSDN博客_springboot 手动获取bean

手动获取配置文件中的数据

// SpringUtil 是自己写的工具包,代码见上面的 手动获取bean
Environment environment = SpringUtil.getBean("environment");
String appId = environment.getProperty("wx.info.appId");