@Value注解,用于将配置信息绑定到Bean中

@configurationProperties(prefix=”配置文件的属性的前缀”)

类中属性名必须和配置文件中的相同

@EnableConfigurationProperties(xxx.class)启用·配置信息绑定到Bean

@ConfigurationPropertiesScan(besePackages=”com.huangkeqin.bean”)

@PropertySource(“classpath:/a/b/xxx.properties”)指定数据来源

Categories:

Tags:

暂时没有回复

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注