码上敲享录 > SpringBoot常见问题详解 > @ConfigurationProperties的使用

@ConfigurationProperties的使用

上一章章节目录下一章 2018-04-13已有1883人阅读 评论(0)

1.属性配置文件application.yml

bxCustomerProps:

 domainRest: http://localhost:18082


2.加载属性文件属性的类代码:

@Component

@ConfigurationProperties(
   prefix =
"bxCustomerProps"
)
public class YmlBean {
private String domainRest;
public String getDomainRest() {
return this.domainRest;
   }
public void setDomainRest(String domainRest) {
this.domainRest = domainRest;
   }
}

本文地址:http://www.yayihouse.com/yayishuwu/chapter/1177

向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti
0

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交