SpringBoot默認包掃描機制及使用@ComponentScan指定掃描路徑

SpringBoot默認包掃描機制 標註了@Component和@Component的衍生註解如@Controller,@Service,@Repository就能夠把當前的Bean加入到IOC容器中。那麼SpringBoot是如何知道要去掃描@Component註解的呢。@ComponentScan作的事情就是告訴Spring從哪裏找到beanjava SpringBoot默認包掃描機制: 從啓
相關文章
相關標籤/搜索