首页 > TAG信息列表 > demoConfig

CommandLineRunner和@PostConstruct区别

实现CommandLineRunner接口;容器启动之后,加载实现类的逻辑资源,已达到完成资源初始化的任务; @PostConstruct;在具体Bean的实例化过程中执行,@PostConstruct注解的方法,会在构造方法之后执行; @Componentpublic class TestRun implements CommandLineRunner { @Override public vo