spring bean定義與加載方式

bean 定義

Xml


Annotation


Java based 


factoryBean


加載方式

xml加載
ApplicationContext applicationContext=
new ClassPathXmlApplicationContext("bean1.xml","bean2.xml");
<context:component-scan base-package="com.example"></context:component-scan>複製代碼
java代碼


Annotation掃描

相關文章
相關標籤/搜索