首页下载资源开发技术IOC之基于注解的配置bean(下)

ZIPIOC之基于注解的配置bean(下)

evankaka11.17KB需要积分:1

资源文件列表:

SpringApplyChapter4_4.zip 大约有31个文件
  1. SpringApplyChapter4_4/
  2. SpringApplyChapter4_4/.classpath 470B
  3. SpringApplyChapter4_4/.project 397B
  4. SpringApplyChapter4_4/.settings/
  5. SpringApplyChapter4_4/.settings/org.eclipse.jdt.core.prefs 598B
  6. SpringApplyChapter4_4/bin/
  7. SpringApplyChapter4_4/bin/beans.xml 810B
  8. SpringApplyChapter4_4/bin/com/
  9. SpringApplyChapter4_4/bin/com/mucfc/
  10. SpringApplyChapter4_4/bin/com/mucfc/dao/
  11. SpringApplyChapter4_4/bin/com/mucfc/dao/UserDao.class 789B
  12. SpringApplyChapter4_4/bin/com/mucfc/model/
  13. SpringApplyChapter4_4/bin/com/mucfc/model/User.class 989B
  14. SpringApplyChapter4_4/bin/com/mucfc/service/
  15. SpringApplyChapter4_4/bin/com/mucfc/service/MyComponent.class 1.36KB
  16. SpringApplyChapter4_4/bin/com/mucfc/service/MySerivce.class 606B
  17. SpringApplyChapter4_4/bin/com/mucfc/test/
  18. SpringApplyChapter4_4/bin/com/mucfc/test/Test.class 1.43KB
  19. SpringApplyChapter4_4/src/
  20. SpringApplyChapter4_4/src/beans.xml 810B
  21. SpringApplyChapter4_4/src/com/
  22. SpringApplyChapter4_4/src/com/mucfc/
  23. SpringApplyChapter4_4/src/com/mucfc/dao/
  24. SpringApplyChapter4_4/src/com/mucfc/dao/UserDao.java 422B
  25. SpringApplyChapter4_4/src/com/mucfc/model/
  26. SpringApplyChapter4_4/src/com/mucfc/model/User.java 355B
  27. SpringApplyChapter4_4/src/com/mucfc/service/
  28. SpringApplyChapter4_4/src/com/mucfc/service/MyComponent.java 889B
  29. SpringApplyChapter4_4/src/com/mucfc/service/MySerivce.java 433B
  30. SpringApplyChapter4_4/src/com/mucfc/test/
  31. SpringApplyChapter4_4/src/com/mucfc/test/Test.java 892B

资源介绍:

IOC之基于注解的配置bean(下),具体效果和过程看博文 http://blog.csdn.net/evankaka/article/details/45077041
package com.mucfc.test; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import com.mucfc.service.MyComponent; import com.mucfc.service.MySerivce; public class Test { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); MySerivce service= context.getBean("service", MySerivce.class); MyComponent myComponent=context.getBean("myComponent", MyComponent.class); System.out.println("--------list--------"); for (int i = 0; i < myComponent.getUserList().size(); i++) { System.out.println(myComponent.getUserList().get(i)); } System.out.println(service.getUserDao()); ; ((ClassPathXmlApplicationContext)context).destroy(); } }
100+评论
captcha