SpringBoot應用啓動服務要執行一些初始化操做的可用方法@PostConstruct與CommandLineRunner、ApplicationRunner

首先來講說javax.annotation-api下的@PostConstruct【這裏聲明一個問題,和@PostConstruct對應的還有個@PreDestroy,不少文章都寫成@PreConstruct,沒有這個註解哈,這個是一個小問題,這裏提一下】java 在Spring中,構造器Constructor,@Autowired,@PostConstruct三者的執行順序,首先說@PostCo
相關文章
相關標籤/搜索