随笔分类 -  spring boot

摘要:@ConfigurationProperties vs. @Value If you define a set of configuration keys for your own components, we recommend you group them in a POJO annotated 阅读全文
posted @ 2021-09-16 21:29 橙木鱼 阅读(21) 评论(0) 推荐(0) 编辑
摘要:针对一些在应用启动后,但是实际接收请求前的执行任务比如配置加载,bean注入,可以使用ApplicationRunner or CommandLineRunner接口来实现. 这两个接口都只提供了一个 run 方法, 它会在SpringApplication.run(…​) 执行完之前被调用. 使用 阅读全文
posted @ 2021-09-15 23:26 橙木鱼 阅读(91) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示