使用Spring api 寫xml配置文件

這是兩個bean,有兩種寫法 ,個人習慣...

<?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-2.5.xsd">

  <bean id="u" class="com.bjsxt.dao.impl.UserDAOImpl">
  </bean>
	
  <bean id="userService" class="com.bjsxt.service.UserService">
  	<property name="userDAO" ref="u" />
  		
  </bean>
  

</beans>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章