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掃描