摘要: springboot允许你将配置外部化,这样你就可以在不同的环境中使用相同的应用程序代码。你可以使用properties文件、YAML文件、环境变量和命令行参数来外部化配置。属性值可以使用@Value注释直接注入bean,可以通过Spring的环境抽象进行访问,也可以通过@Configuration 阅读全文
posted @ 2020-08-22 10:41 codedot 阅读(315) 评论(0) 推荐(0) 编辑
摘要: SpringApplication类提供了一种方便的方法来引导从main()方法启动的Spring应用程序。在许多情况下,可以委托给静态SpringApplication.run方法,如下例所示: public static void main(String[] args) { SpringAppl 阅读全文
posted @ 2020-08-22 10:39 codedot 阅读(225) 评论(0) 推荐(0) 编辑