一、set方法注入
二、构造函数方法注入
三、p名称空间注入
1.引入 p 名称空间
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
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.xsd">
2.使用 p 名称空间.
* 普通属性: p:属性名称=””
* 对象类型属性: p:属性名称-ref=””
四、spel注入
五、复杂类型注入
1.数组
2.List
3.Map
4.Properties