【Spring註解系列07】Spring注入Bean有哪些方式總結

給Spring容器中註冊組件方式: 1)、包掃描+組件標註註解(@Controller/@Service/@Repository/@Component) 2)、@Bean 導入的第三方包裏面的組件 3)、@Import 快速給容器中導入一個組件         1)、普通class類對象,id默認是全類名         2)、實現ImportSelector接口的class類對象,返回須要導入的
相關文章
相關標籤/搜索