bean.xml

 
  
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2.  
  3. <beans xmlns="http://www.springframework.org/schema/beans" 
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  5. xmlns:context="http://www.springframework.org/schema/context" 
  6. xsi:schemaLocation="http://www.springframework.org/schema/beans  
  7. http://www.springframework.org/schema/beans/spring-beans-2.5.xsd  
  8. http://www.springframework.org/schema/context  
  9. http://www.springframework.org/schema/context/spring-context-2.5.xsd  
  10. ">  
  11. <context:annotation-config />  
  12. <bean id="personService" 
  13. class="com.huqianhao.service.impl.PersonServiceBean">  
  14. </bean>  
  15. <bean id="personDao" class="com.huqianhao.dao.impl.PersonDaoImpl">  
  16. </bean>  
  17.  
  18. </beans>  
  19.  
  20. package com.huqianhao.service.impl;  
  21.  
  22. import javax.annotation.Resource;  
  23.  
  24. import com.huqianhao.dao.PersonDao;  
  25. import com.huqianhao.service.PersonService;  
  26.  
  27. public class PersonServiceBean implements PersonService {  
  28.  
  29. @Resource  
  30. private PersonDao personDao;  
  31.  
  32. public void save(){  
  33. personDao.save();  
  34. }  

其余代码省略