当前位置:网站首页>@ConfigurationProperties和@EnableConfigurationProperties
@ConfigurationProperties和@EnableConfigurationProperties
2022-07-31 05:19:00 【想要飞翔的企鹅】
@ConfigurationProperties 是springboot的一个注解,如下图
这个注解作用将appllication.yml文件中的配置文件转化成bean对象使用
@EnableConfigurationProperties是让@ConfigurationProperties生效的注解
① yml配置文件
② 配置bean类
③ 使用该bean类
除此之外,如下图配置就可以直接使用该bean,不用再添加@EnableConfigurationProperties,这样配置就可以让bean生效。
边栏推荐
猜你喜欢
The content of the wangeditor editor is transferred to the background server for storage
Webrtc从理论到实践二: 架构
企业级 DevOps 究竟是什么?
UR3机器人运动学分析之正运动学分析
在 AWS 上从零开始设置 Incredibuild 构建系统
Pytorch learning notes 09 - multiple classification problem
DOM操作-事件的绑定与解绑
routeros KVM安装LEDE 20191030最新版应用
DingTalk Enterprise Internal-H5 Micro Application Development
【Rhapsody学习笔记】2:Count Down
随机推荐
实现离线文件推流成rtsp 2
About iframe
client
数据库/表的基本操作
alert弹框处理,div块处理,上传文件
Image binarization processing of opencv
Debian 搭建 WireGuard 服务端
VRchat_udon脚本介绍:傻瓜式教程教你如何实现VRchat地图的功能
力扣刷题.快乐数
ES6-新增的基本数据:Symbol
Pytorch study notes 10 - detailed explanation of convolutional neural network and application of multi-classification task of mnist dataset
ES6-Map、Set与Arrary的转换
a:自我介绍
文件内容浏览cut、uniq、sort、tr命令的使用,
box-shadow related properties
Pytorch study notes 13 - Basic_RNN
MySQL官网8.0.17 安装教程(适合离线安装)
2021年开发人员的绊脚石:构建时间长
ES6-Map和Set
测试——用例篇