什么是名称空间?
作用:Schema区分同名元素。(有点类似于java的包)
这个在配置文件里面必须进行引入:
xmlns:p="http://www.springframework.org/schema/p"
使用方法:
p:<属性名>="xx"引入常量值
p:<属性名>-<ef="xx"引用其它Bean对象
将<property>
子元素 简化为 元素的属性
<!-- p名称空间p:id必须和属性名一 样
p:car-ref-"car"复杂数据类型(bean)的属性注入
<bean name= "person2”class= "cn.constructor . Person" p:id= "1" p:name="张飞” p:car-ref="car"/>
配置时不需要 子元素,简化了配置 .