黑马程序员技术交流社区
标题:
【成都校区】Spring依赖注入
[打印本页]
作者:
江山美人
时间:
2019-5-31 14:04
标题:
【成都校区】Spring依赖注入
<?xml version="1.0" encoding="UTF-8"?>
<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.xsd">
<bean id="userdao" class="dao.imp.Daoimp">
<property name="list">
<list>
<bean class="dao.domain.PageBean">
</bean>
<ref bean="pageBean"></ref>
<bean class="dao.domain.PageBean"></bean>
<ref bean="pageBean2"></ref>
</list>
</property>
<property name="map">
<map>
<entry key="1" value-ref="pageBean"></entry>
</map>
</property>
</bean>
<bean id="pageBean2" class="dao.domain.PageBean">
<property name="user" ref="User2"></property>
</bean>
<bean id="pageBean" name="pageBean" class="dao.domain.PageBean">
<property name="name" value="潘坤"></property>
<property name="user" ref="User"></property>
</bean>
<bean id="User" class="dao.domain.User">
<property name="gender" value="男"></property>
</bean>
<bean id="User2" class="dao.domain.User">
<property name="gender" value="男"></property>
</bean>
<bean id="userService" class="userservice.impl.UserServiceimpl">
<constructor-arg name="dao" ref="userdao"></constructor-arg>
</bean>
</beans>
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2