1
我正在瀏覽一些Spring文檔,從那裏我知道<context:annotation-config>
是<context:component-scan>
的子集,這意味着我們可以用<context:annotation-config>
的幫助,我們可以使用帶有一些附加功能的<context:component-scan>
來實現同樣的功能(例如,掃描任何定義的組件的指定basePackage)。
所以我的問題是這兩個的用途是什麼?<context:annotation-config> vs <context:component-scan>
可能被註釋重複:http://stackoverflow.com/questions/7414794/difference-between-contextannotation-config-vs-contextcomponent-scan –