spring_spring简单属性注入

来源:互联网 发布:js根据逗号截取字符串 编辑:程序博客网 时间:2024/06/06 00:22
<?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 name="userDaoImpl" class="com.bjsxd.dao.impl.UserDaoImpl"><property name="daoId" value="12"></property><property name="daoStatus" value="good"></property></bean><!-- <bean id="userService" class="com.bjsxd.service.UserService"> <property name="userDao" ref="userDaoImpl" /> </bean> --><bean id="userService" class="com.bjsxd.service.UserService"><constructor-arg><ref bean="userDaoImpl"/></constructor-arg></bean></beans>

原创粉丝点击