美文网首页
(三)SpringBoot 配置文件自动映射到属性和实体类

(三)SpringBoot 配置文件自动映射到属性和实体类

作者: 丛鹏 | 来源:发表于2022-06-28 10:12 被阅读0次

    1.新建属性class 

        @Component

        @PropertySource({"classpath:application.properties"})

        @ConfigurationProperties(prefix="test")

    2.寻找配置文件classpath:application.properties ,过滤前缀“ prefix="test" ”

    引用

    相关文章

      网友评论

          本文标题:(三)SpringBoot 配置文件自动映射到属性和实体类

          本文链接:https://www.haomeiwen.com/subject/agkovrtx.html