08 2021 档案

Spring_整合Mybatis
摘要:1、导入相关jar包 junit mybatis mysq数据库 Spring相关的 aop织入 mybatis-spring 【new】 <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifact 阅读全文

posted @ 2021-08-28 17:16 沫戏回首 阅读(30) 评论(0) 推荐(0)

Spring_AOP
摘要:使用Spring实现Aop <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.9.4</version> </dependency> 方式一:使用Spring的A 阅读全文

posted @ 2021-08-27 21:33 沫戏回首 阅读(35) 评论(0) 推荐(0)

Spring-AOP与代理模式的比较
摘要:代理模式就是SpringAOP的底层 代理模式的分类 静态代理 动态代理 静态代理 角色分析: 抽象角色:一般会使用接口或者抽象类来解决 真实角色:被代理的角色 代理角色:代理真实角色,然后做一些附属操作 客户:访问代理对象的人! 代码步骤: 接口 package com.ly.demo1; pub 阅读全文

posted @ 2021-08-21 18:11 沫戏回首 阅读(127) 评论(0) 推荐(0)

使用java的方式配置Spring
摘要:实体类: package com.ly.pojo; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.sprin 阅读全文

posted @ 2021-08-20 20:59 沫戏回首 阅读(57) 评论(0) 推荐(0)

Spring——注解
摘要:在Spring4之后,要使用注解开发,必须要保证aop的包的导入了 使用注解需要导入context约束,增加注解的支持。 <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema 阅读全文

posted @ 2021-08-19 21:16 沫戏回首 阅读(30) 评论(0) 推荐(0)

Spring各种类型变量set依赖注入的方法
摘要:一、依赖注入的两种方式:构造器注入和set注入。今天我们来说的就是set注入方式。 首先推荐Spring的中文文档链接:https://www.docs4dev.com/docs/zh/spring-framework/5.1.3.RELEASE/reference 下面所记录的文档中都有详细的介绍 阅读全文

posted @ 2021-08-08 22:10 沫戏回首 阅读(217) 评论(0) 推荐(0)

Spring_IOC创建对象方式
摘要:Spring容器默认走的是无参构造。当然也可以走有参构造。 有参构造: package com.ly.pojo; public class User { private String name; //Spring默认采用无参构造来创建对象 /* public User(){ System.out.p 阅读全文

posted @ 2021-08-08 14:33 沫戏回首 阅读(51) 评论(0) 推荐(0)

导航