
Java Spring
schangxiang
这个作者很懒,什么都没留下…
展开
-
Spring AOP创建Throwdvice实例
1、异常发生的时候,通知某个服务对象做处理2、实现throwsAdvice接口接口实现: 1 2 3 4 5 6 7 8 9 10 11 publicinterfaceIHello { publicvoidsayHello(...原创 2019-07-07 15:56:34 · 257 阅读 · 0 评论 -
Spring AOP 创建Advice 基于Annotation
1 2 3 4 5 6 7 8 9 10 11 12 publicinterfaceIHello { publicvoidsayHello(String str); } publicclassHelloimplementsIH...原创 2019-07-08 06:49:06 · 153 阅读 · 0 评论 -
Spring AOP 创建Advice 定义pointcut、advisor
前面定义的advice都是直接植入到代理接口的执行之前和之后,或者在异常发生时,事实上,还可以对植入的时机定义的更细。Pointcut定义了advice的应用时机,在Spring中pointcutAdvisor将pointcut和advice结合成一个对象,spring内建的pointcut都对应着pointcutAdvisor,常见的有下面两种:NameMatchMeth...原创 2019-07-09 07:22:09 · 291 阅读 · 0 评论 -
第一个Spring Demo
目录1、Main文件2、applicationContext.xml3、注意点1、Main文件package com.pb;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationCo...原创 2019-07-06 09:09:29 · 126 阅读 · 0 评论 -
Spring概述学习笔记
目录1、Spring概述2、Spring体系结构1、Spring Core2、Spring Context3、Spring AOP4、Spring DAO5、Spring ORM6、Spring Web7、Spring MVC3、Spring架构1、Bean组件2、Context组件3、Core组件1、Spring概述Spring致...原创 2019-07-06 14:41:23 · 271 阅读 · 0 评论 -
Spring核心概念学习笔记
目录1、Spring主要用到两种设计模式1.1 工厂模式1.2 单例模式2、Spring的核心机制2.1 控制反转和依赖注入3.1 面向方面编程1、Spring主要用到两种设计模式1.1 工厂模式Spring容器就是实例化和管理全部Bean的工厂。工厂模式可以将Java对象的调用者从被调用者的实现逻辑中分离出来。调用者只关心被调用者必须满足的某种规...原创 2019-07-07 05:37:27 · 175 阅读 · 0 评论 -
Bean管理学习笔记
目录1、BeanFactory介绍1.1首先什么是Bean?1.2什么是BeanFactory?1.3 BeanFactory的作用:2、ApplicationContext3、Bean定义3.1配置文件3.2定义bean节点时通常要指定两个属性3.3 bean在Spring容器中有两种行为4、创建Bean4.1 Bean的查找机制4...原创 2019-07-07 08:44:39 · 434 阅读 · 0 评论 -
Spring AOP创建BeforeAdvice和AfterAdvice实例
BeforeAdvice 1、会在目标对象的方法执行之前被调用。 2、通过实现MethodBeforeAdvice接口来实现。 3、该接口中定义了一个方法即before方法,before方法会在目标对象target之前执行。AfterAdvice1、在目标对象的方法执行之后被调用2、通过实现AfterReturningAdvice接口实现...原创 2019-07-07 10:04:42 · 682 阅读 · 0 评论 -
Spring AOP创建AroundAdvice实例
AroundAdvice 1、在方法之前和之后来执行相应的操作2、实现MethodInterceptor接口接口文件: 1 2 3 4 5 6 7 8 9 publicinterfaceIHello { publicvoids...原创 2019-07-07 10:50:28 · 214 阅读 · 0 评论