依赖注入-xml-p命名空间

尚硅谷 Spring - 30

引入 xmlns:p="http://www.springframework.org/schema/p",然后可以在 <bean> 标签中,通过 p:属性名 或者 p:属性名-ref 进行注入。

<bean id="studentp" class="com.atguigu.spring6.iocxml.dimap.Student"
p:sid="100" p:sname="mary" p:lessonList-ref="lessonList" p:teacherMap-ref="teacherMap">
</bean>
posted @ 2023-07-15 14:10  ShaunY  阅读(6)  评论(0编辑  收藏  举报