1. 程式人生 > >Spring - Bean裝配

Spring - Bean裝配

補充 完成 can alt sca not ima 註冊 區別

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

補充說明:

<context:component-scan>與<context:annotation-config>的區別:
<context:component-scan>包含了<context:annotation-config>的全部功能,通常在使用前者後,就不用再使用後者。
<context:component-scan>可以掃描基於類的註解,而<context:annotation-config>只能在完成了bean的註冊之後去處理bean中的方法或者成員變量的註解。

技術分享圖片

<context:include-filter>與<context:exclude-filter>的type取值:

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

默認:no

Spring - Bean裝配