美文网首页
4. spring boot的配置

4. spring boot的配置

作者: 光小月 | 来源:发表于2019-08-09 14:29 被阅读0次

文件application.proprities, application.yml, bootstrap.properties, bootstrap.yml

  1. 自定义属性 @Value, 类上加入@Configuration
  2. 自定义配置类 @ConfigurationProperties(prefix="task")
  3. 参数间引用 -- 占位符 ${}
  4. 加载指定的配置文件 @PropertySource("classpath: task.properties")

相关文章

网友评论

      本文标题:4. spring boot的配置

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