@Component @ConfigurationProperties(prefix = "") @EnableConfigurationProperties(pojo.class

2022/7/3 23:21:43

本文主要是介绍@Component @ConfigurationProperties(prefix = "") @EnableConfigurationProperties(pojo.class,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

@Component 把类注册到bean容器

 

 

@ConfigurationProperties(prefix = "") 从yml文件中读取前缀为...的属性值  prefix只能小写,数字,下划线

 

 

@EnableConfigurationProperties(pojo.class) 和@Component不能一起使用,否则bean冲突



这篇关于@Component @ConfigurationProperties(prefix = "") @EnableConfigurationProperties(pojo.class的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程