springboot启动时获取Bean

在springboot中咱们经过配置类来加载配置信息,而在配置类中是没法加载Bean的。咱们有时候须要在项目启动时加载数据库数据,这就形成没法使用配置的数据源,而spring给咱们提供了一个方法,就是实现CommandLineRunner。java @Component @Order(value = 2) public class DroolsAutoDbRule implements Comma
相关文章
相关标签/搜索