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

相关文章
相关标签/搜索