目录

9、代理模式

9.2 加深理解

9.3 动态代理都没动态代理

10. AOP

10.1 什么是AOP

10.2 AOP在Spring中的作用

10.3 使用Spring实现AOP


9、代理模式

角色分析:

  • 抽象角色:一般会使用接口或者抽象类来解决
  • 真实角色:被代理的角色
  • 代理角色:代理别人的角色,里面处理一些业务
  • 客户:访问代理对象的人

步骤:
1.接口

//租房
public interface Rent {public void rent();
}

2.真实角色

public class Host implements Rent{@Overridepublic void rent() {System.out.println("房东要出租房子");}
}

3.代理角色

public class Proxy implements Rent{// 代理角色第一件事,找房东搭伙  先用组合,少用继承(有局限)private Host host;//组合public Proxy() {}public Proxy(Host host) {this.host = host;}@Overridepublic void rent() {seeHouse();host.rent();contract();fare();}//看房public void seeHouse(){System.out.println("中介带你看房");}//签合同public void contract(){System.out.println("签租赁合同");}//收中介费public void fare(){System.out.println("收中介费");}
}

4.客户端访问代理

public class Client {public static void main(String[] args) {//房东要租房子Host host = new Host();//中介Proxy proxy = new Proxy(host);proxy.rent();}
}

代理模式的好处:

  • 可以使真实角色的操作更加纯粹,不用去关注一些公共的业务
  • 公共业务交给代理角色,实现业务分工
  • 公共业务发生扩展时,方便集中管理

缺点:

  • 一个真实角色就会产生一个代理角色:代码量会翻倍,开发效率变低

9.2 加深理解

9.3 动态代理都没动态代理

  • 动态代理和静态代理角色一样
  • 动态代理的代理类是动态生成的,不是我们直接写好的
  • 动态代理分为两大类:基于接口的动态代理、基于类的动态代理
    - 基于接口----JDK动态代理
    - 基于类:cglib
    - java字节码实现:javasist 【常用】

需要了解两个类:Proxy:代理,InvocationHandler:调用处理程序

  • proxy这个类用来动态生成代理对象
  • InvocationHandler用来处理业务
  • 模板
public class ProxyInvocationHandler implements InvocationHandler {//与业务接口组合private Object Target;//set方法 注入业务public void setTarget(Object target) {Target = target;}//生成代理类//获取当前类的加载器,获取业务的接口,当前对象public Object getProxy(){return Proxy.newProxyInstance(this.getClass().getClassLoader(),Target.getClass().getInterfaces(),this);}//处理业务,并返回结果@Overridepublic Object invoke(Object proxy, Method method, Object[] args) throws Throwable {//niubilog(method.getName());Object result = method.invoke(Target, args);return result;}//添加日志public void log(String msg){System.out.println("[debug]调用了"+msg+"方法");}
}

动态代理的好处:

  • 可以使真实角色的操作更加纯粹,不用去关注一些公共的业务
  • 公共业务交给代理角色,实现业务分工
  • 公共业务发生扩展时,方便集中管理
  • 一个动态代理类代理的一个接口,一般就是对应的一类业务
  • 一个动态代理类可以代理多个类,只要是实现了同一个接口即可

10. AOP

10.1 什么是AOP

aop(aspect oriented programming):面向切面编程。通过预编译的方式和运行期动态代理实现程序功能的统一维护的一种技术。

10.2 AOP在Spring中的作用

提供声明式事务:允许用户自定义切面

10.3 使用Spring实现AOP

使用AOP织入,需要导入一个依赖包

<dependencies><dependency><groupId>org.aspectj</groupId><artifactId>aspectjweaver</artifactId><version>1.9.4</version></dependency>
</dependencies>

10.3.1 方式一:使用spring的API接口

public class AfterLog implements AfterReturningAdvice {
public class Log implements MethodBeforeAdvice {

动态代理代理的是接口,静态代理代理的是实体类

  • 1.配置了 前置日志和后置日志
  • 2.准备了UserService和UserServiceImpl实体类 实现了增删改查

配置:

    <!--注册bean    --><bean id="userService" class="com.hardy.service.UserServiceImpl"/><bean id="log" class="com.hardy.log.Log"/><bean id="afterLog" class="com.hardy.log.AfterLog"/><!--方式一:  使用原生spring API接口    --><!--配置aop--><aop:config><!--切入点   expression:表达式   execution(要执行的位置! *  *  *  * ) 第一个*表示方法类型--><aop:pointcut id="pointcut" expression="execution(* com.hardy.service.UserServiceImpl.*(..))"/><!--  执行环绕增加      --><aop:advisor advice-ref="log" pointcut-ref="pointcut"/><aop:advisor advice-ref="afterLog" pointcut-ref="pointcut"/></aop:config>

log

public class Log implements MethodBeforeAdvice {@Overridepublic void before(Method method, Object[] objects, Object o) throws Throwable {System.out.println(method.getClass().getName()+"类,执行了"+method.getName()+"方法");}
}public class AfterLog implements AfterReturningAdvice {@Overridepublic void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {System.out.println("执行了"+method.getName()+"方法"+returnValue);}
}

测试:

public class MyTest {public static void main(String[] args) {ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");//动态代理代理的是UserService接口UserService userservice = (UserService) context.getBean("userService");userservice.query();}
}

10.3.2 方式二:使用自定义类实现AOP

自定义log类

public class DiyPointCut {public void before(){System.out.println("========方法执行前=========");}public void after(){System.out.println("========方法执行后=========");}
}

配置:

    <!--注册bean    --><bean id="userService" class="com.hardy.service.UserServiceImpl"/><!--方式二:  自定义类    --><bean id="diy" class="com.hardy.diy.DiyPointCut"/><aop:config><aop:aspect ref="diy"><!-- 切入点--><aop:pointcut id="point" expression="execution(* com.hardy.service.UserServiceImpl.*(..))"/><!--  切面 --><aop:before method="before" pointcut-ref="point"/><aop:after method="after" pointcut-ref="point"/></aop:aspect></aop:config>

测试:

public class MyTest {public static void main(String[] args) {ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");//动态代理代理的是UserService接口UserService userservice = (UserService) context.getBean("userService");userservice.query();}
}

10.3.3 方式三:使用注解实现AOP

自定义一个类充当切面:

//方式三:使用注解方式实现AOP
@Aspect //标注这个类是一个切面
public class AnnotationPointCut {@Before("execution(* com.hardy.service.UserServiceImpl.*(..))")public void before(){System.out.println("========方法执行前=========");}@After("execution(* com.hardy.service.UserServiceImpl.*(..))")public void after(){System.out.println("========方法执行后=========");}//在环绕增强中,我们可以给定一个参数,代表我们要获取处理切入的点@Around("execution(* com.hardy.service.UserServiceImpl.*(..))")public void around(ProceedingJoinPoint pj) throws Throwable {System.out.println("========环绕前=========");Signature signature = pj.getSignature();//获得签名System.out.println("signature:"+signature);//打印调用的方法//执行方法Object proceed = pj.proceed();System.out.println("========环绕后=========");}
}

配置:

    <!--注册bean    --><bean id="userService" class="com.hardy.service.UserServiceImpl"/><!--方式三:  使用注解实现   --><bean id="annotationPointCut" class="com.hardy.diy.AnnotationPointCut"/><!--开启注解支持    --><aop:aspectj-autoproxy/>

测试:

public class MyTest {public static void main(String[] args) {ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");//动态代理代理的是UserService接口UserService userservice = (UserService) context.getBean("userService");userservice.query();}
}

结果:环绕在最外层最早和最晚执行,

========环绕前=========
signature:void com.hardy.service.UserService.query()
========方法执行前=========
查询了一条数据
========方法执行后=========
========环绕后=========

11. 整合Mybatis

步骤:

  • 1.导入相关jar包

    • Junit
    • mybatis
    • MySQL
    • spring相关
    • aop织入
    • mybatis-spring 【new】

配置:

    <dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.13.1</version><scope>test</scope></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.47</version></dependency><dependency><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId><version>3.5.7</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>5.1.19.RELEASE</version></dependency><!--spring操作数据库的话,还需要spring-jdbc--><dependency><groupId>org.springframework</groupId><artifactId>spring-jdbc</artifactId><version>5.1.9.RELEASE</version></dependency><dependency><groupId>org.aspectj</groupId><artifactId>aspectjweaver</artifactId><version>1.9.4</version></dependency><dependency><groupId>org.mybatis</groupId><artifactId>mybatis-spring</artifactId><version>2.0.2</version></dependency></dependencies>

maven 资源导出问题

    <build><resources><resource><directory>src/main/java</directory><includes><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>false</filtering></resource><resource><directory>src/main/resources</directory><includes><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>false</filtering></resource></resources></build>
  • 2.编写配置文件
  • 3.测试

11.1 回忆Mybatis

1.编写实体类

@Data
public class User {private int id;private String name;private String pwd;
}

2.编写核心配置文件
mybatis-config.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configurationPUBLIC "-//mybatis.org//DTD Config 3.0//EN""http://mybatis.org/dtd/mybatis-3-config.dtd">
<!--configuration核心配置文件-->
<configuration><typeAliases><package name="com.hardy.pojo"/></typeAliases><environments default="development"><environment id="development"><transactionManager type="JDBC"/><dataSource type="POOLED"><property name="driver" value="com.mysql.jdbc.Driver"/><property name="url" value="jdbc:mysql://localhost:3306/mybatis?userSSL=true&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC"/><property name="username" value="root"/><property name="password" value="root"/></dataSource></environment></environments><mappers><mapper class="com.hardy.mapper.UserMapper"/></mappers>
</configuration>

3.编写接口
UserMapper

public interface UserMapper {List<User> selectUser();
}

4.编写Mapper.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Config 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace="com.hardy.mapper.UserMapper"><select id="selectUser" resultType="user">select * from mybatis.user;</select>
</mapper>

5.测试

    @Testpublic void test() throws IOException {String resource = "mybatis-config.xml";InputStream in = Resources.getResourceAsStream(resource);SqlSessionFactory sessionFactory = new SqlSessionFactoryBuilder().build(in);SqlSession sqlSession = sessionFactory.openSession(true);UserMapper mapper = sqlSession.getMapper(UserMapper.class);List<User> users = mapper.selectUser();for (User user : users) {System.out.println(user);}}

注意点:
1.找不到类就是maven资源导出问题 target中没有导出文件
2.编写完mapper.xml文件后,一定要去mybatis-config.xml中绑定mapper
3.数据库UTC设置 Asia/Shanghai
4.工具类放下下面

11.2 Mybatis-spring

1.编写数据源配置
2.sqlSessionFactory
3.sqlSessionTemplete

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation="http://www.springframework.org/schema/beanshttps://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttps://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/aophttps://www.springframework.org/schema/aop/spring-aop.xsd"><!--Datasource:使用spring的数据源替换mybatis的配置  c3p0 dbcp druid我们这里使用spring提供的jdbc:org.springframework.jdbc.datasource--><bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"><property name="driverClassName" value="com.mysql.jdbc.Driver"/><property name="url" value="jdbc:mysql://localhost:3306/mybatis?userSSL=true&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC"/><property name="username" value="root"/><property name="password" value="root"/></bean><!--创建sqlSessionFactory--><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"><property name="dataSource" ref="dataSource"/><!--bound mybatis--><property name="configLocation" value="classpath:mybatis-config.xml"/><!--注册usermapper--><property name="mapperLocations" value="classpath:com/hardy/mapper/*.xml"/></bean><!--SqlSessionTemplate,就是我们使用的sqlsession--><bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"><!--通过构造器给SqlSessionTemplate 传入参数   它需要一个sqlSessionFactory且它没有set方法,只能用构造器注入--><constructor-arg index="0" ref="sqlSessionFactory"/></bean>
</beans>

4.给接口添加实现类

//给接口添加实现类
public class UserMapperImpl implements UserMapper{//原来我们所有操作都使用sqlsession,现在所有都使用SqlSessionTemplate,他俩一样private SqlSessionTemplate sqlSession;//spring万物皆注入  一定要来个set方法public void setSqlSession(SqlSessionTemplate sqlSession) {this.sqlSession = sqlSession;}@Overridepublic List<User> selectUser() {UserMapper mapper = sqlSession.getMapper(UserMapper.class);return  mapper.selectUser();}
}

5.将自己写的实现类,注入到spring中

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation="http://www.springframework.org/schema/beanshttps://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttps://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/aophttps://www.springframework.org/schema/aop/spring-aop.xsd"><import resource="spring-dao.xml"/><!--将实习类 注入到spring中--><bean id="userMapper" class="com.hardy.mapper.UserMapperImpl"><!--UserMapperImpl 类中需要SqlSessionTemplate这个参数,传入      --><property name="sqlSession" ref="sqlSession"/></bean>
</beans>

6.测试

    @Testpublic void test() throws IOException {ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");UserMapper mapper = (UserMapper) context.getBean("userMapper");for (User user : mapper.selectUser()) {System.out.println(user);}}

方式二 SqlSessionDaoSupport

spring-dao.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation="http://www.springframework.org/schema/beanshttps://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttps://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/aophttps://www.springframework.org/schema/aop/spring-aop.xsd"><!--Datasource:使用spring的数据源替换mybatis的配置  c3p0 dbcp druid我们这里使用spring提供的jdbc:org.springframework.jdbc.datasource--><bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"><property name="driverClassName" value="com.mysql.jdbc.Driver"/><property name="url" value="jdbc:mysql://localhost:3306/mybatis?userSSL=true&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC"/><property name="username" value="root"/><property name="password" value="root"/></bean><!--创建sqlSessionFactory--><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"><property name="dataSource" ref="dataSource"/><!--bound mybatis--><property name="configLocation" value="classpath:mybatis-config.xml"/><!--注册usermapper--><property name="mapperLocations" value="classpath:com/hardy/mapper/*.xml"/></bean><!--SqlSessionTemplate,就是我们使用的sqlsession--><bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"><!--通过构造器给SqlSessionTemplate 传入参数   它需要一个sqlSessionFactory且它没有set方法,只能用构造器注入--><constructor-arg index="0" ref="sqlSessionFactory"/></bean>
</beans>

实现类:UserMapperImpl2

public class UserMapperImpl2 extends SqlSessionDaoSupport implements UserMapper{@Overridepublic List<User> selectUser() {
//        SqlSession sqlSession = getSqlSession();
//        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
//        return mapper.selectUser();return getSqlSession().getMapper(UserMapper.class).selectUser();}
}

applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation="http://www.springframework.org/schema/beanshttps://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttps://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/aophttps://www.springframework.org/schema/aop/spring-aop.xsd"><import resource="spring-dao.xml"/><!--方式二:将实现类 注入到spring中--><bean id="userMapper2" class="com.hardy.mapper.UserMapperImpl2"><!--UserMapperImpl 类中需要SqlSessionTemplate这个参数,传入      --><property name="sqlSessionFactory" ref="sqlSessionFactory"/></bean>
</beans>

测试:

    @Testpublic void test() throws IOException {ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");UserMapper mapper = (UserMapper) context.getBean("userMapper2");for (User user : mapper.selectUser()) {System.out.println(user);}}

12、声明式事务

12.1 回顾事务

事务的ACID原则:

12.2 spring中的事务管理

增删改需要事务,查询不需要(查询设置为只读)

12.2.1 补充:spring中的七种事务传播属性:propagation 传播

required(依赖):支持当前事务,如果当前没有事务,就新建一个事务 【默认】
supports(支持):支持当前事务,如果当前没有事务,就以非事务的方式执行
mandatory(强制):支持当前事务,如果当前没有事务,就抛出异常
required_new:新建事务,如果当前存在事务,把当前事务挂起
not_supported:以非事务方式执行操作,如果当前存在事务,就把当前事务挂起
never:以非事务方式执行,如果当前存在事务,则抛出异常
nested(嵌套):支持当前事务,如果当前事务存在,则执行一个嵌套事务,如果当前没有事务,就新建一个事务
例如:

    <!--结合AOP实现事务的织入--><!--配置事务的类:spring--><tx:advice id="txAdvice" transaction-manager="transactionManager"><!--给哪些方法配置事务--><!--配置事务的传播特性:new--><tx:attributes><tx:method name="add" propagation="REQUIRED"/><tx:method name="delete" propagation="REQUIRED"/><tx:method name="update" propagation="REQUIRED"/><tx:method name="query" read-only="true"/></tx:attributes></tx:advice>

真实开发

  <tx:method name="*" propagation="REQUIRED"/>

12.2.2 案例

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beanshttps://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttps://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/aophttps://www.springframework.org/schema/aop/spring-aop.xsdhttp://www.springframework.org/schema/txhttps://www.springframework.org/schema/tx/spring-tx.xsd"><!--Datasource:使用spring的数据源替换mybatis的配置  c3p0 dbcp druid我们这里使用spring提供的jdbc:org.springframework.jdbc.datasource--><bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"><property name="driverClassName" value="com.mysql.jdbc.Driver"/><property name="url" value="jdbc:mysql://localhost:3306/mybatis?userSSL=true&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=UTC"/><property name="username" value="root"/><property name="password" value="root"/></bean><!--创建sqlSessionFactory--><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"><property name="dataSource" ref="dataSource"/><!--bound mybatis--><property name="configLocation" value="classpath:mybatis-config.xml"/><!--注册usermapper--><property name="mapperLocations" value="classpath:com/hardy/mapper/*.xml"/></bean><!--SqlSessionTemplate,就是我们使用的sqlsession--><bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"><!--通过构造器给SqlSessionTemplate 传入参数   它需要一个sqlSessionFactory且它没有set方法,只能用构造器注入--><constructor-arg index="0" ref="sqlSessionFactory"/></bean><!--配置声明式事务  官网的--><bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"><!--有属性可以用 property 赋值,没有可以用构造器--><property name="dataSource" ref="dataSource"/></bean><!--结合AOP实现事务的织入--><!--配置事务的类:spring--><tx:advice id="txAdvice" transaction-manager="transactionManager"><!--给哪些方法配置事务--><!--配置事务的传播特性:new--><tx:attributes><tx:method name="add" propagation="REQUIRED"/><tx:method name="delete" propagation="REQUIRED"/><tx:method name="update" propagation="REQUIRED"/><tx:method name="query" read-only="true"/><tx:method name="*" propagation="REQUIRED"/></tx:attributes></tx:advice><!--配置事务切入--><aop:config><aop:pointcut id="txPointCut" expression="execution(* com.hardy.mapper.*.*(..))"/><!--切入    txAdvice包下的所有方法 都会编织上事务   --><aop:advisor advice-ref="txAdvice" pointcut-ref="txPointCut"/></aop:config></beans>
x

12.2.3 思考:为什么需要事务?

(kuang) Spring 笔记相关推荐

  1. 狂神说Spring笔记(全网最全)

    Spring框架 1.Spring 狂胜说Spring笔记以及代码 1.1 简介 Spring : 春天 -->给软件行业带来了春天 2002年,Rod Jahnson首次推出了Spring框架 ...

  2. Spring:笔记整理(1)——HelloWorld

    Spring:笔记整理(1)--HelloWorld 导入JAR包: 核心Jar包 Jar包解释 Spring-core 这个jar 文件包含Spring 框架基本的核心工具类.Spring 其它组件 ...

  3. spring 笔记2:Spring MVC : Did not find handler method for 问题的解决

    spring 笔记2:Spring MVC : Did not find handler method for 问题的解决 参考文章: (1)spring 笔记2:Spring MVC : Did n ...

  4. spring 笔记持续更新2012年9月16日 11:54:45

    spring笔记 点击下载立体结构笔记http://download.csdn.net/detail/yao__shun__yu/4608595 点击进入我的个人编程网站,初步建设中http://mo ...

  5. 跟杨春娟学Spring笔记:AOP之SpringAOP引介通知

    跟杨春娟学Spring笔记:AOP之SpringAOP引介通知 完成:第一遍 1.如何代码实现AOP之SpringAOP引介通知? IntroductionInterceptor(引介通知) 在目标类 ...

  6. [转]Spring 笔记

    Spring 笔记 笔记总结到位,非常经典. 参考资料: Spring 笔记(江南白衣博物馆) Spring下单元测试的要点 Spring配置要点 Spring事务管理

  7. Spring笔记9--Spring的三大重要配置(alias,bean,import)

    我的所有spring笔记大集锦 Spring5入门知识整合(持续更新) 目前而言就bean用的最多,import在以后的团队协作中用的很多 下面逐一说说各自用法 1.alias关键字 首先alias是 ...

  8. 【从零开始学Spring笔记】工厂类

    大家可以关注作者的账号,关注从零开始学Spring笔记文集.也可以根据目录前往作者的博客园博客进行学习.本片文件将基于黑马程序员就业班视频进行学习以及资料的分享,并记录笔记和自己的看法.欢迎大家一起学 ...

  9. 跟杨春娟学Spring笔记:表达式装配

    跟杨春娟学Spring笔记:表达式装配 完成:第一遍 1.使用表达式注入有哪几种? 如果是表达式注入,必须在value里写#{表达式} 运算符:等于 符号: == 文本类型运算符: eq 运算符:小于 ...

最新文章

  1. 话说Ubuntu和FreeBSD将要合成一个新的版本:UbuntuBSD
  2. SAP PM 入门系列15 - IW41 维护订单确认
  3. Hadoop系列四:Hadoop之Hive篇
  4. 【转】十分有用的linux shell学习总结
  5. JSP语法,运行机理等
  6. [bzoj2743]采花
  7. 深度学习中防止过拟合的方法
  8. jupyter notebook 内核挂掉
  9. 创建zookeeper客户端
  10. Java线程的5种状态及切换(透彻讲解)-京东面试
  11. 计算机网络路由计算,计算机网络中的多播路由算法
  12. hausaufgabe--python 22- Recurse
  13. 如何管理一盘散沙的团队?
  14. java陆小凤的游戏_陆小凤之金鹏王朝游戏
  15. mysql 查询存储过程 速度_查询mysql过程
  16. oracle column name as sign,Oracle日常性能查看 - ella的个人空间 - 51Testing软件测试网 51Testing软件测试网-软件测试人的精神家园...
  17. 前端css解决z-index 上层元素遮挡下层元素的方法
  18. android 天气动画,为app制作炫酷天气动画 – WeatherView
  19. Python教程:批量合成PDF
  20. 生活中的小技巧-2:洗衣机洗衣服打结缠绕,该如何解决?学上几个实用招数

热门文章

  1. js代码如何单独运行,快速查看效果及功能
  2. 男女之间送礼物的含义,别送错了啊!
  3. 安装laravelExcel详细教程包含安装问题和导入Excel数据中文问题解决办法
  4. 大数据平台的防火墙、服务网关Knox
  5. 美国商学院申请条件知多少,雅思专家来解惑
  6. 5FITC-Acp-RQIKIWFQNRRMKWKK-NH2
  7. redis详解之数据备份与恢复
  8. 快来一起拼团,惠购EasyRecovery
  9. Wordpress ThickBox 特效修改:添加“查看原图”
  10. 如何在没有微软商店的情况下在Windows 10上安装应用程序