Spring-1-透彻理解Spring XML的Bean创建--IOC
学习目标
上一篇文章我们介绍了什么是Spring,以及Spring的一些核心概念,并且快速快发一个Spring项目,实现IOC和DI,今天具体来讲解IOC
能够说出IOC的基础配置和Bean作用域
了解Bean的生命周期
能够说出Bean的实例化方式
一、Bean的基础配置
问题导入
问题1:在<bean>
标签上如何配置别名?
问题2:Bean的默认作用范围是什么?如何修改?
1 Bean基础配置【重点】
配置说明
2 Bean别名配置
配置说明
注意事项:
获取bean无论是通过id还是name获取,如果无法获取到,将抛出异常NoSuchBeanDefinitionException
NoSuchBeanDefinitionException: No bean named 'studentDaoImpl' available
代码演示
【第0步】创建项目名称为10_2_IOC_Bean
的maven项目
【第一步】导入Spring坐标
<dependencies><!--导入spring的坐标spring-context,对应版本是5.2.10.RELEASE--><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.3.15</version></dependency><!-- 导入junit的测试包 --><dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter</artifactId><version>5.8.2</version><scope>test</scope></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.28</version></dependency></dependencies>
【第二步】导入Student实体类
@Data
@ToString
@AllArgsConstructor
public class Student {private String name;private String address;private Integer age;private Integer status;
}
【第三步】定义Spring管理的类(接口)
-
StudentDao接口和StudentDaoImpl实现类
package com.zbbmeta.dao;public interface StudentDao {/*** 添加学生*/void save();
}
package com.zbbmeta.dao.impl;import com.zbbmeta.dao.StudentDao;public class StudentDaoImpl implements StudentDao {@Overridepublic void save() {System.out.println("DAO: 添加学生信息到数据库...");}
}
-
StudentService接口和StudentServiceImpl实现类
package com.zbbmeta.service;public interface StudentService {/*** 添加学生*/void save();
}
package com.zbbmeta.service.impl;import com.zbbmeta.dao.StudentDao;
import com.zbbmeta.dao.impl.StudentDaoImpl;
import com.zbbmeta.service.StudentService;public class StudentServiceImpl implements StudentService {//创建成员对象private StudentDao studentDao = new StudentDaoImpl();@Overridepublic void save() {}
}
【第四步】创建Spring配置文件在resources目录下,配置对应类作为Spring管理的bean对象
-
定义application.xml配置文件并配置StudentDaoImpl
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><!--目标:熟悉bean标签详细的属性应用--><!--name属性:可以设置多个别名,别名之间使用逗号,空格,分号等分隔--><bean name="studentDao2,abc studentDao3" class="com.zbbmeta.dao.impl.StudentDaoImpl" id="studentDao"></bean></beans>
注意事项:bean定义时id属性和name中名称不能有重复的在同一个上下文中(IOC容器中)不能重复
【第四步】根据容器别名获取Bean对象
package com.zbbmeta;import com.zbbmeta.dao.StudentDao;
import org.springframework.context.support.ClassPathXmlApplicationContext;public class NameApplication {public static void main(String[] args) {/*** 从IOC容器里面根据别名获取对象执行*///1.根据配置文件application.xml创建IOC容器ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("application.xml");//2.从IOC容器里面获取id="abc"对象StudentDao studentDao = (StudentDao) ac.getBean("abc");//3.执行对象方法studentDao.save();//4.关闭容器ac.close();}
}
打印结果
3 Bean作用范围配置【重点】
配置说明
扩展: scope的取值不仅仅只有singleton和prototype,还有request、session、application、 websocket ,表示创建出的对象放置在web容器(tomcat)对应的位置。比如:request表示保存到request域中。
代码演示
在application.xml中配置prototype格式
-
定义application.xml配置文件并配置StudentDaoImpl
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><!--目标:熟悉bean标签详细的属性应用--><!--scope属性:定义bean的作用范围,一共有5个singleton: 设置单例创建对象(推荐,也是默认值),好处:节省资源prototype: 设置多例创建对象,每次从IOC容器获取的时候都会创建对象,获取多次创建多次。request: 在web开发环境中,IOC容器会将对象放到request请求域中,对象存活的范围在一次请求内。请求开始创建对象,请求结束销毁对象session: 在web开发环境中,IOC容器会将对象放到session会话域中,对象存活的范围在一次会话内。会话开始开始创建对象,会话销毁对象销毁。global-session: 是多台服务器共享同一个会话存储的数据。--><bean class="com.zbbmeta.dao.impl.StudentDaoImpl" id="studentDao4" scope="prototype"></bean></beans>
根据容器别名获取Bean对象
package com.zbbmeta;import com.zbbmeta.dao.StudentDao;
import org.springframework.context.support.ClassPathXmlApplicationContext;public class ScopeApplication {public static void main(String[] args) {/*** Bean的作用域范围演示*///1.根据配置文件application.xml创建IOC容器ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("application.xml");//2.从IOC容器里面获取id="studentService"对象System.out.println("=========singleton(单例)模式=========");StudentDao studentDao = (StudentDao) ac.getBean("studentDao");StudentDao studentDao1 = (StudentDao) ac.getBean("studentDao");System.out.println("studentDao = " + studentDao);System.out.println("studentDao1 = " + studentDao1);System.out.println("=========prototype模式=========");StudentDao studentDao2 = (StudentDao) ac.getBean("studentDao4");StudentDao studentDao3 = (StudentDao) ac.getBean("studentDao4");System.out.println("studentDao2 = " + studentDao2);System.out.println("studentDao3 = " + studentDao3);//4.关闭容器ac.close();}
}
打印结果
注意:在我们的实际开发当中,绝大部分的Bean是单例的,也就是说绝大部分Bean不需要配置scope属性。
二、Bean的实例化
思考:Bean的实例化方式有几种?
2 实例化Bean的三种方式
2.1 构造方法方式【重点】
-
BookDaoImpl实现类
public class StudentDaoImpl implements StudentDao {public StudentDaoImpl() {System.out.println("Student dao constructor is running ....");}@Overridepublic void save() {System.out.println("DAO: 添加学生信息到数据库...");}
}
-
application.xml配置
<!--目标:讲解bean创建方式--><!--创建StudentDaoImpl对象方式1:默认调用类的无参构造函数创建--><bean id="studentDao" class="com.zbbmeta.dao.impl.StudentDaoImpl"/>
-
AppForInstanceBook测试类
public class OneApplication {public static void main(String[] args) {/*** 无参构造方式创建Bean*///1.根据配置文件application.xml创建IOC容器ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("application.xml");//2.从IOC容器里面获取id="studentService"对象StudentDao studentDao = (StudentDao) ac.getBean("studentDao");//3.执行对象方法studentDao.save();//4.关闭容器ac.close();}
}
-
运行结果
注意:无参构造方法如果不存在,将抛出异常BeanCreationException
2.2 静态工厂方式
-
StudentDaoFactory工厂类
package com.zbbmeta.factory;import com.zbbmeta.dao.StudentDao;
import com.zbbmeta.dao.impl.StudentDaoImpl;public class StudentDaoFactory {
// 静态工厂创建对象public static StudentDao getStudentDao(){System.out.println("Student static factory setup....");return new StudentDaoImpl();}
}
-
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"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><!--目标:讲解bean创建方式--><!--创建StudentDaoImpl对象方式1:默认调用类的无参构造函数创建-->
<!-- <bean id="studentDao" class="com.zbbmeta.dao.impl.StudentDaoImpl"/>--><!--创建StudentDaoImpl对象方式2:调用静态工厂方法创建对象加入IOC容器class="com.zbbmeta.factory.StudentDaoFactory" 设置工厂类全名factory-method="getStudentDao" 调用工厂的静态方法
--><bean class="com.zbbmeta.factory.StudentDaoFactory" factory-method="getStudentDao" id="studentDao2"></bean></beans>
注意:测试前最好把之前使用Bean标签创建的对象进行注释
-
TwoApplication测试类
public class TwoApplication {public static void main(String[] args) {/*** 无参构造方式创建Bean*///1.根据配置文件application.xml创建IOC容器ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("application.xml");//2.从IOC容器里面获取id="studentService"对象StudentDao studentDao = (StudentDao) ac.getBean("studentDao2");//3.执行对象方法studentDao.save();//4.关闭容器ac.close();}
}
-
运行结果
2.3 实例工厂方式
-
UserDao接口和UserDaoImpl实现类
//利用实例方法创建StudentDao对象public StudentDao getStudentDao2(){System.out.println("调用了实例工厂方法");return new StudentDaoImpl();}
-
StudentDaoFactory工厂类添加方法
//实例工厂创建对象
public class UserDaoFactory {public UserDao getUserDao(){return new UserDaoImpl();}
}
-
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"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><!--目标:讲解bean创建方式--><!--创建StudentDaoImpl对象方式1:默认调用类的无参构造函数创建-->
<!-- <bean id="studentDao" class="com.zbbmeta.dao.impl.StudentDaoImpl"/>--><!--创建StudentDaoImpl对象方式2:调用静态工厂方法创建对象加入IOC容器class="com.zbbmeta.factory.StudentDaoFactory" 设置工厂类全名factory-method="getStudentDao" 调用工厂的静态方法
-->
<!-- <bean class="com.zbbmeta.factory.StudentDaoFactory" factory-method="getStudentDao" id="studentDao2"></bean>--><!--创建BookDaoImpl对象方式3:调用实例工厂方法创建对象加入IOC容器class="com.itheima.factory.BookDaoFactory" 设置工厂类全名factory-method="getBookDao" 调用工厂的静态方法
--><!--第一步:创建工厂StudentDaoFactory对象--><bean class="com.zbbmeta.factory.StudentDaoFactory" id="studentDaoFactory"></bean><!--第一步:调用工厂对象的getStudentDao2()实例方法创建StudentDaoImpl对象加入IOC容器factory-bean="studentDaoFactory" 获取IOC容器中指定id值的对象factory-method="getStudentDao2" 如果配置了factory-bean,那么这里设置的就是实例方法名--><bean factory-bean="studentDaoFactory" factory-method="getStudentDao2" id="studentDao3"></bean></beans>
-
ThreeApplication测试类
package com.zbbmeta;import com.zbbmeta.dao.StudentDao;
import org.springframework.context.support.ClassPathXmlApplicationContext;public class ThreeApplication {public static void main(String[] args) {/*** 无参构造方式创建Bean*///1.根据配置文件application.xml创建IOC容器ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("application.xml");//2.从IOC容器里面获取id="studentService"对象StudentDao studentDao = (StudentDao) ac.getBean("studentDao3");//3.执行对象方法studentDao.save();//4.关闭容器ac.close();}
}
-
运行结果
三、Bean的生命周期【了解】
问题导入
问题1:多例的Bean能够配置并执行销毁的方法?
问题2:如何做才执行Bean销毁的方法?
1 生命周期相关概念介绍
-
生命周期:从创建到消亡的完整过程
-
bean生命周期:bean从创建到销毁的整体过程
-
bean生命周期控制:在bean创建后到销毁前做一些事情
1.1生命周期过程
- 初始化容器
-
创建对象(内存分配)
-
执行构造方法
-
执行属性注入(set操作)
-
执行bean初始化方法
-
- 使用bean
-
执行业务操作
-
- 关闭/销毁容器
-
执行bean销毁方法
-
2 代码演示
2.1 Bean生命周期控制
【第0步】创建项目名称为10_4_IOC_BeanLifeCycle
的maven项目
【第一步】导入Spring坐标
<dependencies><!--导入spring的坐标spring-context,对应版本是5.2.10.RELEASE--><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>5.3.15</version></dependency><!-- 导入junit的测试包 --><dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter</artifactId><version>5.8.2</version><scope>test</scope></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.28</version></dependency></dependencies>
【第二步】导入Student实体类
@Data
@ToString
@AllArgsConstructor
public class Student {private String name;private String address;private Integer age;private Integer status;
}
【第三步】定义Spring管理的类(接口)
-
StudentDao接口和StudentDaoImpl实现类
package com.zbbmeta.dao;public interface StudentDao {/*** 添加学生*/void save();
}
package com.zbbmeta.dao.impl;import com.zbbmeta.dao.StudentDao;public class StudentDaoImpl implements StudentDao {public StudentDaoImpl(){System.out.println("Student Dao 的无参构造");}@Overridepublic void save() {System.out.println("DAO: 添加学生信息到数据库...");}public void init(){System.out.println("Student Dao 的初始化方法");}public void destroy(){System.out.println("Student Dao 的销毁方法");}
}
【第四步】创建Spring配置文件在resources目录下,配置对应类作为Spring管理的bean对象
-
定义application.xml配置文件并配置StudentDaoImpl
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><!--目标:创建StudentDaoImpl对象:设置生命周期方法init-method="init" 在对象创建后立即调用初始化方法destroy-method="destroy":在容器执行销毁前立即调用销毁的方法注意:只有单例对象才会运行销毁生命周期方法
--><bean class="com.zbbmeta.dao.impl.StudentDaoImpl" id="studentDao" init-method="init" destroy-method="destroy"></bean>
</beans>
【第四步】根据容器别名获取Bean对象
package com.zbbmeta;import com.zbbmeta.dao.StudentDao;
import org.springframework.context.support.ClassPathXmlApplicationContext;public class LifeCycleApplication {public static void main(String[] args) {//1.根据配置文件application.xml创建IOC容器ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("application.xml");//2.从IOC容器里面获取id="studentService"对象StudentDao studentDao = (StudentDao) ac.getBean("studentDao");//3.执行对象方法studentDao.save();//4.关闭容器ac.close();}
}
打印结果
3 Bean销毁时机
-
容器关闭前触发bean的销毁
- 关闭容器方式:
-
手工关闭容器 调用容器的
close()
操作 -
注册关闭钩子(类似于注册一个事件),在虚拟机退出前先关闭容器再退出虚拟机 调用容器的
registerShutdownHook()
操作
-
public class LifeCycleApplication {public static void main(String[] args) {//1.根据配置文件application.xml创建IOC容器ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("application.xml");//2.从IOC容器里面获取id="studentService"对象StudentDao studentDao = (StudentDao) ac.getBean("studentDao");//3.执行对象方法studentDao.save();//4.关闭容器
// ac.close();//注册关闭钩子函数,在虚拟机退出之前回调此函数,关闭容器ac.registerShutdownHook();}
}
相关文章:

Spring-1-透彻理解Spring XML的Bean创建--IOC
学习目标 上一篇文章我们介绍了什么是Spring,以及Spring的一些核心概念,并且快速快发一个Spring项目,实现IOC和DI,今天具体来讲解IOC 能够说出IOC的基础配置和Bean作用域 了解Bean的生命周期 能够说出Bean的实例化方式 一、Bean的基础配置 …...

【JAVA】类和对象
作者主页:paper jie的博客 本文作者:大家好,我是paper jie,感谢你阅读本文,欢迎一建三连哦。 本文录入于《JAVASE语法系列》专栏,本专栏是针对于大学生,编程小白精心打造的。笔者用重金(时间和精…...

jenkins准备
回到目录 jenkins是一个开源的、提供友好操作界面的持续集成(CI)工具,主要用于持续、自动的构建/测试软件项目、监控外部任务的运行。Jenkins用Java语言编写,可在Tomcat等流行的servlet容器中运行,也可独立运行。通常与版本管理工具(SCM)、构…...

【Rust】Rust学习
文档:Rust 程序设计语言 - Rust 程序设计语言 简体中文版 (bootcss.com) 墙裂推荐这个文档 第一章入门 入门指南 - Rust 程序设计语言 简体中文版 第二章猜猜看游戏 猜猜看游戏教程 - Rust 程序设计语言 简体中文版 (bootcss.com) // 导入库 use std::io; use s…...
Linux 常用命令之配置环境变量 PATH
PATH是系统环境变量中的一种,同时将一些二进制文件的绝对路径追加进去,则在系统终端中可以发现这些路径下的文件。 一. 环境变量设置 export PATH<二进制文件的绝对路径>:$PATH 以下为结合实际例子的操作 1、临时设置 打开一个终端执行如下命令 e…...

flask-----蓝图
1.引入蓝图 flask都写在一个文件中,项目这样肯定不行,会导致循环导入的问题,分目录,分包,使用蓝图划分目录。 2.使用蓝图 步骤如下: -1 实例化得到一个蓝图对象-order_blueBlueprint(order,__name__,tem…...

学习左耳听风栏目90天——第一天 1-90(学习左耳朵耗子的工匠精神,对技术的热爱)【洞悉技术的本质,享受科技的乐趣】
洞悉技术的本质,享受科技的乐趣 第一篇,我的感受就是 耗叔是一个热爱技术,可以通过代码找到快乐的技术人。 作为it从业者,我们如何可以通过代码找到快乐呢?这是一个问题? 至少目前,我还没有这种…...
后端登录安全的一种思路
PS:作者是小白能接触到的就只会这样写。勿喷。 前提 思路: 结合io流将登录token存储到配置文件中,不将token存储到浏览器端,从而避免盗取。 下面jwt的学习可以参考下这个: JWT --- 入门学习_本郡主是喵的博客-CSDN博客 JWT工具类 Component public class JWTtU…...

【深度学习_TensorFlow】激活函数
写在前面 上篇文章我们了解到感知机使用的阶跃函数和符号函数,它们都是非连续,导数为0的函数: 建议回顾上篇文章,本篇文章将介绍神经网络中的常见激活函数,这些函数都是平滑可导的,适合于梯度下降算法。 写…...

机器学习笔记之优化算法(七)线搜索方法(步长角度;非精确搜索;Wolfe Condition)
机器学习笔记之优化算法——线搜索方法[步长角度,非精确搜索,Wolfe Condition] 引言回顾: Armijo \text{Armijo} Armijo准则及其弊端 Glodstein \text{Glodstein} Glodstein准则及其弊端 Wolfe Condition \text{Wolfe Condition} Wolfe Condi…...

十四.redis哨兵模式
redis哨兵模式 1.概述2.测试3.哨兵模式优缺点 redis哨兵模式基础是主从复制 1.概述 主从切换的技术方法:当主节点服务器宕机后,需要手动把一台从服务器切换为主服务器,这就需要人工干预,费时费力,还会造成一段时间内服…...

采用UWB技术开发的智慧工厂人员定位系统源码【UWB定位基站、卡牌】
UWB (ULTRA WIDE BAND, UWB) 技术是一种无线载波通讯技术,它不采用正弦载波,而是利用纳秒级的非正弦波窄脉冲传输数据,因此其所占的频谱范围很宽。UWB定位系统依托在移动通信,雷达,微波电路,云计算与大数据…...

当你软件测试遇上加密接口,是不是就不能测了?
相信大家在工作中做接口测试的时候,肯定会遇到一个场景,那就是你们的软件,密码是加密存储的。 那么这样的话,我们在执行接口的时候,对于密码的处理就开始头疼了。 所以,本文将使用jmeter这款java开源的接…...
Flink
Flink(Apache Flink)是一个开源的分布式流处理引擎和批处理框架。它是由 Apache 软件基金会维护的项目,旨在处理大规模数据的实时流式处理和批处理任务。Flink 提供了强大的流处理和批处理功能,具有低延迟、高吞吐量和高容错性&am…...
python入门常用操作
python常用操作 1、ndarry数组的切片2、print用法2.1格式化输出format2.2字符串格式化输出 3、均值滤波函数 1、ndarry数组的切片 例如一个5列的ndarry数组,想要获取第2列和第3列数据,可以用 #(1)用法1 data[:,1:3],…...
SpringBoot复习:(21)自定义ImportBeanDefinitionRegistrar
要达到的目的:将某个包下使用了某个自定义注解(比如MyClassMapper)的类注册到Spring 容器。 一、自定义注解: package com.example.demo.service;import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy;Rete…...

小黑子—JavaWeb:第五章 - JSP与会话跟踪技术
JavaWeb入门5.0 1. JSP1.1 JSP快速入门1.2 JSP原理1.3 JSP脚本1.3.1 JSP缺点 1.4 EL 表达式1.5 JSTL 标签1.5.1 JSTL 快速入门1.5.1 - I JSTL标签if1.5.1 - II JSTL标签forEach 1.6 MVC模式1.7 三层架构1.8 实现案例1.8.1 环境准备1.8.2 查询所有1.8.3 添加数据1.8.4 修改1.8.4…...

Python - 【socket】 客户端client重连处理简单示例Demo(一)
一. 前言 在Python中,使用socket进行网络通信时,如果连接断开,可以通过以下步骤实现重连处理 二. 示例代码 1. 定义一个函数,用于建立socket连接 import socketdef connect_socket(host, port):while True:try:# 建立socket连…...

Redis 基础
1.定义 Redis 是一个高性能的key-value数据库,key是字符串类型。 2.核心特点: 单进程: Redis的服务器程序采用的是单进程模型来处理客户端的请求。对读写时间的响 应是通过对epoll函数的包装来做到的。 3.数据类型: 键的类型…...

【0805作业】Linux中 AB终端通过两根有名管道进行通信聊天(半双工)
作业一:打开两个终端,要求实现AB进程对话【两根管道】 打开两个终端,要求实现AB进程对话 A进程先发送一句话给B进程,B进程接收后打印B进程再回复一句话给A进程,A进程接收后打印重复1.2步骤,当收到quit后&am…...

CTF show Web 红包题第六弹
提示 1.不是SQL注入 2.需要找关键源码 思路 进入页面发现是一个登录框,很难让人不联想到SQL注入,但提示都说了不是SQL注入,所以就不往这方面想了 先查看一下网页源码,发现一段JavaScript代码,有一个关键类ctfs…...
线程同步:确保多线程程序的安全与高效!
全文目录: 开篇语前序前言第一部分:线程同步的概念与问题1.1 线程同步的概念1.2 线程同步的问题1.3 线程同步的解决方案 第二部分:synchronized关键字的使用2.1 使用 synchronized修饰方法2.2 使用 synchronized修饰代码块 第三部分ÿ…...

渗透实战PortSwigger靶场-XSS Lab 14:大多数标签和属性被阻止
<script>标签被拦截 我们需要把全部可用的 tag 和 event 进行暴力破解 XSS cheat sheet: https://portswigger.net/web-security/cross-site-scripting/cheat-sheet 通过爆破发现body可以用 再把全部 events 放进去爆破 这些 event 全部可用 <body onres…...

学校招生小程序源码介绍
基于ThinkPHPFastAdminUniApp开发的学校招生小程序源码,专为学校招生场景量身打造,功能实用且操作便捷。 从技术架构来看,ThinkPHP提供稳定可靠的后台服务,FastAdmin加速开发流程,UniApp则保障小程序在多端有良好的兼…...
工程地质软件市场:发展现状、趋势与策略建议
一、引言 在工程建设领域,准确把握地质条件是确保项目顺利推进和安全运营的关键。工程地质软件作为处理、分析、模拟和展示工程地质数据的重要工具,正发挥着日益重要的作用。它凭借强大的数据处理能力、三维建模功能、空间分析工具和可视化展示手段&…...

cf2117E
原题链接:https://codeforces.com/contest/2117/problem/E 题目背景: 给定两个数组a,b,可以执行多次以下操作:选择 i (1 < i < n - 1),并设置 或,也可以在执行上述操作前执行一次删除任意 和 。求…...

《通信之道——从微积分到 5G》读书总结
第1章 绪 论 1.1 这是一本什么样的书 通信技术,说到底就是数学。 那些最基础、最本质的部分。 1.2 什么是通信 通信 发送方 接收方 承载信息的信号 解调出其中承载的信息 信息在发送方那里被加工成信号(调制) 把信息从信号中抽取出来&am…...

【2025年】解决Burpsuite抓不到https包的问题
环境:windows11 burpsuite:2025.5 在抓取https网站时,burpsuite抓取不到https数据包,只显示: 解决该问题只需如下三个步骤: 1、浏览器中访问 http://burp 2、下载 CA certificate 证书 3、在设置--隐私与安全--…...

WordPress插件:AI多语言写作与智能配图、免费AI模型、SEO文章生成
厌倦手动写WordPress文章?AI自动生成,效率提升10倍! 支持多语言、自动配图、定时发布,让内容创作更轻松! AI内容生成 → 不想每天写文章?AI一键生成高质量内容!多语言支持 → 跨境电商必备&am…...
HTML前端开发:JavaScript 常用事件详解
作为前端开发的核心,JavaScript 事件是用户与网页交互的基础。以下是常见事件的详细说明和用法示例: 1. onclick - 点击事件 当元素被单击时触发(左键点击) button.onclick function() {alert("按钮被点击了!&…...