Spring学习

来源:互联网 发布:淘宝动漫周边那家店好 编辑:程序博客网 时间:2024/06/06 01:59

beans节点属性:

xmlns ——> http://www.springframework.org/schema/beans

xmlns:xsi——> http://www.w3.org/2001/XMLSchema-instance

xsi:schemaLocation——> http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

例:

<beansxmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

</beans>


bean(beans的子节点)节点属性:

1.id bean唯一标识

2.class java实例类(如com.iwencai.HelloWorld

3.scope作用域(如singleton、prototype)

4.init-method生命周期(初始化实例对象)

5.destroy-method生命周期(销毁实例对象)

6.parent 继承(值是该bean要继承的父类)

7.abstract 抽象标识(值为布尔类型)


property(bean的子节点)节点属性

1.name 实例化java对象的属性

2.value实例化java对象属性的值








0 0