spring boot应用程序获取配置文件的配置信息的方法:

1.通过@Value注释获取

2.通过Environment类获取

3.通过@ConfigurationProperties获取

application.properties文件内容:

1 server.port=8080
2 
3 
4 spring.main.banner-mode=off
5 
6 myconfig.mail.port=1234
View Code

相关文章:

  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
  • 2021-08-31
  • 2021-11-20
  • 2021-06-04
猜你喜欢
  • 2021-04-02
  • 2022-12-23
  • 2021-12-27
  • 2022-02-20
  • 2021-12-23
  • 2021-04-04
  • 2022-12-23
相关资源
相似解决方案