springboot项目初始化加载

@Component
public class Runner implements CommandLineRunner { 
   @Override
   public void run(String... args) throws Exception {
     System.out.println("The Runner start to initialize ...");
   }
}

项目启动的时候加载缓存之类的可以使用此方法,主要是实现CommandLineRunner,然后重写run方法

posted @ 2018-08-18 22:51  me-ht  阅读(313)  评论(0编辑  收藏  举报