上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 45 下一页
摘要: 1.代理模式介绍 为某一个对象(委托类)提供一个代理,用来控制对这个对象的访问。 委托类和代理类有共同的父类/父类接口 代理类会对请求做预处理,过滤,将请求分配给指定对象 2.代理模式原则 1.代理类和委托类有共同行为 2.代理类可以增强委托人行为 3.常见代理模式:静态代理,动态代理 阅读全文
posted @ 2022-07-14 18:18 lwx_R 阅读(29) 评论(0) 推荐(0)
摘要: 1. Error querying database. Cause: java.sql.SQLException: No suitable driver found for http://www.example.com 原因:分析编译后的文件,发现配置文件的url被改成http://www.exam 阅读全文
posted @ 2022-07-07 22:46 lwx_R 阅读(52) 评论(0) 推荐(0)
摘要: 1.mysql-connector-java-8.0.28 地址:https://downloads.mysql.com/archives/c-j/ 选择Plantform independent 2.mybatis-3.5.2 地址:http://www.mybatis.cn/82.html 3. 阅读全文
posted @ 2022-07-07 22:21 lwx_R 阅读(217) 评论(0) 推荐(0)
摘要: spring.xml <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSch 阅读全文
posted @ 2022-07-07 09:54 lwx_R 阅读(31) 评论(0) 推荐(0)
摘要: 1.手动注入方法:set注入,构造器注入,静态工厂注入,实例化工厂注入 1.1 set注入 在类中需要别的bean/基本数据类型,需要设置对应的set方法 实例化A时需要B注入,先实例化A,再把B实例化 public class UserService { //bean类型注入 private da 阅读全文
posted @ 2022-07-04 11:52 lwx_R 阅读(55) 评论(0) 推荐(0)
摘要: ![](https://img2022.cnblogs.com/blog/2211217/202207/2211217-20220704095123092-1229996196.png) 阅读全文
posted @ 2022-07-04 09:52 lwx_R 阅读(11) 评论(0) 推荐(0)
摘要: /** * IOC容器Bean对象实例化方法 * 1、构造器实例化:Bean对象需要空构造 * 2、静态工厂实例化 * 3、实例化工厂实例化 */ public void fun(){ BeanFactory factory= new ClassPathXmlApplicationContext(" 阅读全文
posted @ 2022-07-03 10:45 lwx_R 阅读(37) 评论(0) 推荐(0)
摘要: public void fun0(){ //Spring配置文件加载:得到Spring上下文环境 //单个配置文件 ApplicationContext ac=new ClassPathXmlApplicationContext("spring.xml"); //多配置文件 1.可变参数 传入多个文 阅读全文
posted @ 2022-07-03 10:44 lwx_R 阅读(35) 评论(0) 推荐(0)
摘要: 1.新建web项目 2.修改pom.xml 从mvn中找spring依赖 <!-- 添加Spring依赖--> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context --> <dependency> <g 阅读全文
posted @ 2022-07-02 11:33 lwx_R 阅读(49) 评论(0) 推荐(0)
摘要: 1.Spring容器机制 容器是Spring实现功能的基础,所有配置过的类被纳入容器,通过容器对象管理bean。 1.1 BeanFactory接口 最基本的容器接口,定义创建和管理bean的方法 1.2 ApplicationContext接口 建立在BeanFactory接口之上 1.3 容器启 阅读全文
posted @ 2022-07-02 10:57 lwx_R 阅读(35) 评论(0) 推荐(0)
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 45 下一页