1.新建属性class
@Component
@PropertySource({"classpath:application.properties"})
@ConfigurationProperties(prefix="test")
2.寻找配置文件classpath:application.properties ,过滤前缀“ prefix="test" ”
引用
1.新建属性class
@Component
@PropertySource({"classpath:application.properties"})
@ConfigurationProperties(prefix="test")
2.寻找配置文件classpath:application.properties ,过滤前缀“ prefix="test" ”
引用
本文标题:(三)SpringBoot 配置文件自动映射到属性和实体类
本文链接:https://www.haomeiwen.com/subject/agkovrtx.html
网友评论