spring-210724-03–IOC容器–Bean管理XML方式-p名称空间注入
使用p名称空间注入,可以简化基于xml配置方式
在beams约束中添加:
xmlns:p="http://www.springframework.org/schema/p"
testP.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="book" class="com.bgy.spring.Book" p:bname="数据结构" p:bauthor="严蔚敏">
</bean>
</beans>