06 2015 档案

23Spring使用JdbcTemplate和JdbcDaoSupport
摘要:首先需要添加c3p0包和jdbc包数据库:CREATE DATABASE IF NOT EXISTS `spring` /*!40100 DEFAULT CHARACTER SET utf8 */;USE `spring`;-- MySQL dump 10.13 Distrib 5.6.13, ... 阅读全文

posted @ 2015-06-24 23:15 jec 阅读(275) 评论(0) 推荐(0) 编辑

22Spring基于配置文件的方式配置AOP
摘要:直接看代码:package com.cn.spring.aop.impl;//加减乘除的接口类public interface ArithmeticCalculator { int add(int i, int j); int sub(int i, int j); int mul(... 阅读全文

posted @ 2015-06-23 21:12 jec 阅读(370) 评论(0) 推荐(0) 编辑

21Spring重用切点表达式
摘要:直接看代码:package com.cn.spring.aop.impl;//加减乘除的接口类public interface ArithmeticCalculator { int add(int i, int j); int sub(int i, int j); int mul(... 阅读全文

posted @ 2015-06-23 19:12 jec 阅读(313) 评论(1) 推荐(0) 编辑

20Spring切面的优先级
摘要:通过使用@order注解指定切面的优先级,值越小,优先级越高代码:package com.cn.spring.aop.impl;//加减乘除的接口类public interface ArithmeticCalculator { int add(int i, int j); int sub... 阅读全文

posted @ 2015-06-23 15:15 jec 阅读(349) 评论(0) 推荐(0) 编辑

19Spring返回通知&异常通知&环绕通知
摘要:在前置通知和后置通知的基础上加上返回通知&异常通知&环绕通知代码:package com.cn.spring.aop.impl;//加减乘除的接口类public interface ArithmeticCalculator { int add(int i, int j); int sub... 阅读全文

posted @ 2015-06-21 11:10 jec 阅读(289) 评论(0) 推荐(0) 编辑

18Spring后置通知
摘要:Spring后置通知,和前置通知类似,直接看代码:package com.cn.spring.aop.impl;//加减乘除的接口类public interface ArithmeticCalculator { int add(int i, int j); int sub(int i, ... 阅读全文

posted @ 2015-06-20 21:34 jec 阅读(175) 评论(0) 推荐(0) 编辑

17Spring前置通知
摘要:1).加入jar包:下载地址 spring-beans-4.1.6.RELEASE.jar commons-logging-1.1.3.jar spring-context-4.1.6.RELEASE.jar spring-core-4.1.6.RELEASE.jar spring-exp... 阅读全文

posted @ 2015-06-20 21:27 jec 阅读(448) 评论(0) 推荐(0) 编辑

15Spring AOP基础
摘要:为什么需要AOP?先来看一段代码:package com.cn.spring.aop.helloworld;//加减乘除的接口类public interface ArithmeticCalculator { int add(int i, int j); int sub(int i, in... 阅读全文

posted @ 2015-06-20 12:53 jec 阅读(162) 评论(0) 推荐(0) 编辑

15Spring泛型依赖注入
摘要:Spring 4.x中可以为子类注入子类对应的泛型类型的成员变量的引用BaseService:有RoleService和UserService两的子类BaseRepepositry:有UserRepository和RoleRepositry两个子类由于 BaseService和 BaseRepepo... 阅读全文

posted @ 2015-06-20 00:09 jec 阅读(193) 评论(0) 推荐(0) 编辑

14Spring通过注解配置Bean(2)
摘要:下面将对13Spring通过注解配置Bean(1)的中Repository、Service、Controller通过注解方式来建立关联。元素还会自动注册AutowiredAnnotationBeanPostProcessor后置处理器实例,该实例可以自动装配具有@Autowired属性。@Autow... 阅读全文

posted @ 2015-06-19 23:07 jec 阅读(415) 评论(0) 推荐(0) 编辑

13Spring通过注解配置Bean(1)
摘要:配置Bean的形式:基于XML文件的方式;基于注解的方式(基于注解配置Bean;基于注解来装配Bean的属性)下面介绍基于注解的方式来配置Bean。——组件扫描(component scanning):Spring能够从classpath下自动扫描,侦测和实例化具有特定注解的组件。——特定组件包括:... 阅读全文

posted @ 2015-06-19 16:26 jec 阅读(215) 评论(0) 推荐(0) 编辑

12.Spring通过FactoryBean配置Bean
摘要:为啥要使用FactoryBean: 在配置Bean的时候,需要用到IOC容器中的其它Bean,这个时候使用FactoryBean配置最合适。public class Car { private String brand; private double price; publi... 阅读全文

posted @ 2015-06-19 11:18 jec 阅读(167) 评论(0) 推荐(0) 编辑

11.Spring通过工厂方法配置Bean
摘要:通过工厂方法配置Bean暴扣静态工厂方法和实例工厂方法。1.静态工厂方法 调用静态工厂方法创建Bean是将对象创建的过程封装到静态方法中,当客户端需要对象时,只需要简单的调用静态方法,而不去关心创建对象的细节。 要声明通过静态方法创建的Bean,需要在Bean的class属性里指定拥有该工厂的方法... 阅读全文

posted @ 2015-06-19 10:54 jec 阅读(147) 评论(0) 推荐(0) 编辑

10.Spring Bean的生命周期
摘要:Spring IOC容器可以管理Bean的生命周期,允许在Bean声明周期的特定点执行定制的任务。Spring IOC容器对Bean的生命周期进行管理的过程。1.通过构造器或工厂方法创建Bean实例2.位Bean的属性设置值和对其他Bean的引用3.调用Bean的初始化方法4.使用Bean5.当容器... 阅读全文

posted @ 2015-06-19 00:31 jec 阅读(175) 评论(0) 推荐(0) 编辑

idea常用快捷键
摘要:转至http://www.open-open.com/lib/view/open1396578860887.htmlIntelliJ Idea 常用快捷键列表Ctrl+Shift + Enter,语句完成“!”,否定完成,输入表达式时按 “!”键Ctrl+E,最近的文件Ctrl+Shift+E,最近... 阅读全文

posted @ 2015-06-17 15:32 jec 阅读(191) 评论(0) 推荐(0) 编辑

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

导航

统计

点击右上角即可分享
微信分享提示