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