随笔分类 -  spring

摘要:1.导入额外的两个jar包: 2.编写接口:Helloworld 3.编写类实现接口:HelloworldImpl1 4.编写类实现接口:HelloworldImpl2 5.编写日子类:TimeHandler 6.编写配置文件:aop.xml 7.编写测试类:Test 8.运行结果如下: 阅读全文
posted @ 2017-07-25 16:16 beibidewomen 阅读(198) 评论(0) 推荐(0)
摘要:1. @Resource 阅读全文
posted @ 2017-07-25 15:34 beibidewomen 阅读(121) 评论(0) 推荐(0)
摘要:1. 配置如下: 2.以上配置对应javaBean中方法如下: 3.上面的绿色背景内容要相对应 nnnn ==> setNnnn 4. 这样:property可以写为: <property name="Nnnn"> 或 <property name="nnnn"> 都是可以的 阅读全文
posted @ 2017-07-25 14:01 beibidewomen 阅读(4196) 评论(0) 推荐(0)
摘要:1. 在spring 配置文件中,添加如下配置: classpath: src目录下。 2.other.xml内容如下: 3. 这样就完成了xml文件的引入 阅读全文
posted @ 2017-07-25 11:28 beibidewomen 阅读(3615) 评论(0) 推荐(0)
摘要:1.导入相应的jar包 2. 编写配置文件:jdbc.properties 3.编写业务类接口:AccountService 4.编写实现类:AccountServiceImpl 5.编写dao层接口:AccountDao 6.编写dao层实现类:AccountDaoImpl 7.配置spring配 阅读全文
posted @ 2017-07-21 18:10 beibidewomen 阅读(176) 评论(0) 推荐(0)
摘要:1. spring推荐使用面向接口编程。 2.spring的好处是:不用修改业务代码,只需要修改配置文件就可以达到我们想要的结果。 3.spring的核心是IOC。 4.依赖注入: 接口注入 set注入 构造注入 5.spring通过反射动态调用的方式,避免了硬编码。 6.applicationCo 阅读全文
posted @ 2017-07-18 14:50 beibidewomen 阅读(213) 评论(0) 推荐(0)