spring中读取配置文件有哪些方法

benjerry / 2023-07-16 / 原文

第一种,@EnbaleConfigurationProperties、@ConfigurationProperties组合

第二种,@Value

第三种,spring提供的Environment对象

第四种,直接读配置文件进行分析