2012年11月23日
摘要: Java输出数组的内容作者:chszs,转载需注明。作者博客主页:http://blog.csdn.net/chszs1. 输出内容最常见的方式// List<String>类型的列表 List<String> list = new ArrayList<String>(); list.add("First"); list.add("Second"); list.add("Third"); list.add("Fourth"); System.out.println(list);输 阅读全文
posted @ 2012-11-23 12:46 YangJin 阅读(629) 评论(0) 推荐(0)
摘要: 1.DI 依赖注入 在Spring框架中,两个组件对象之间具有依赖关系(使用和被使用),依赖注入技术就是将被使用者对象给使用者对象传进去. *1)setter方式注入(推荐) a.在使用者中,定义"接口类型"的变量和setter方法 b.在spring容器配置中,添加<property name="属性" ref="要注入的对象名"> 2)构造方式注入 a.在使用者中,定义"接口类型"的变量和带参数的构造方法 b.在spring容器配置中,添加<constructor-arg index=&quo 阅读全文
posted @ 2012-11-23 12:08 YangJin 阅读(170) 评论(0) 推荐(0)