当前位置: 首页 > news >正文

SSM整合(XML方式)

文章目录

  • SSM整合之后xml方式
  • 1 系统环境
    • 1.1 软件环境
    • 1.2 项目环境
    • 1.3 配置web.xml
    • 1.4 配置jdbc.properties文件
    • 1.5 配置SpringMVC核心文件
    • 1.6 配置Spring的核心文件
    • 1.7 配置MyBatis的核心文件
    • 1.8 配置数据库
    • 1.9 配置文件位置
  • 2 编写后端代码
    • 2.1 编写实体类
    • 2.2 编写Dao接口
    • 2.3 编写Dao映射文件(resource目录下)
    • 2.4 编写Service接口
    • 2.5 编写ServiceImpl实现类
    • 2.6 编写Controller类
    • 2.7 代码映射文件位置
  • 3 编写前端代码
    • 3.1 编写首页index.jsp
    • 3.2 配置Tomcat
    • 3.3 webapp下配置图片
    • 3.4 编写功能页面WEB-INF下
  • 4 运行访问
    • 4.1 请求路径
    • 4.2 增删改查界面
    • 4.3 项目源代码

SSM整合之后xml方式

1 系统环境

1.1 软件环境

软件版本:
IDEA 2021.3
Maven 3.6.3
MySql (Mariadb) 10.10
JDK 1.8

1.2 项目环境

1、创建Maven的web工程
在这里插入图片描述
2、引入pom依赖

 <dependencies><!--servlet的依赖--><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>4.0.1</version><scope>provided</scope></dependency><!--jsp的依赖--><dependency><groupId>javax.servlet</groupId><artifactId>jsp-api</artifactId><version>2.0</version></dependency><!--JSTL表达式--><dependency><groupId>javax.servlet</groupId><artifactId>jstl</artifactId><version>1.2</version></dependency><!--SpringWeb--><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>5.3.1</version></dependency><!--spring事务--><dependency><groupId>org.springframework</groupId><artifactId>spring-tx</artifactId><version>5.3.1</version></dependency><!--jsckson的依赖--><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-core</artifactId><version>2.14.2</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.14.2</version></dependency><!--mybatis的依赖--><dependency><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId><version>3.5.13</version></dependency><!--spring整合mybatis--><dependency><groupId>org.mybatis</groupId><artifactId>mybatis-spring</artifactId><version>2.1.1</version></dependency><!--mysql依赖--><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.28</version></dependency><!--Spring的JDBC--><dependency><groupId>org.springframework</groupId><artifactId>spring-jdbc</artifactId><version>5.3.17</version></dependency><!--druid连接池--><dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>1.2.16</version></dependency><!--单元测试--><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.11</version><scope>test</scope></dependency><!--lombok插件--><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.18.28</version></dependency></dependencies>

3 设置插件

 <build><resources><resource><!--所在的目录--><directory>src/main/java</directory><!--包括目录下的.properties .xml文件都会扫描到--><includes><include>**/*.properties</include><include>**/*.xml</include></includes><filtering>false</filtering></resource></resources><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.1</version><configuration><source>1.8</source><target>1.8</target></configuration></plugin></plugins></build>

1.3 配置web.xml

配置前端控制器

    <!--配置前端控制器--><servlet><servlet-name>myssm</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><param-name>contextConfigLocation</param-name><param-value>classpath:config/springmvc.xml</param-value></init-param><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>myssm</servlet-name><url-pattern>*.do</url-pattern></servlet-mapping>

注册监听器

    <!--注册监听器--><context-param><param-name>contextConfigLocation</param-name><param-value>classpath:config/applicationContext.xml</param-value></context-param><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>

注册字符过滤器,处理中文乱码

    <!--注册字符过滤器--><filter><filter-name>characterEncodingFilter</filter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class><init-param><param-name>encoding</param-name><param-value>utf-8</param-value></init-param><init-param><param-name>forceRequestEncoding</param-name><param-value>true</param-value></init-param><init-param><param-name>forceResponseEncoding</param-name><param-value>true</param-value></init-param></filter><filter-mapping><filter-name>characterEncodingFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping>

1.4 配置jdbc.properties文件

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/db002
jdbc.username=root
jdbc.password=root

1.5 配置SpringMVC核心文件

<?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:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd"><!--springMVC的配置文件  配置controller和其他web相关对象--><!--配置扫描--><context:component-scan base-package="com.hx.controller"/><!--配置视图解析器--><bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/jsp/"/><property name="suffix" value=".jsp"/></bean><!--配置注解驱动--><mvc:annotation-driven></mvc:annotation-driven>
</beans>

1.6 配置Spring的核心文件

<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:p="http://www.springframework.org/schema/p"xmlns:tx="http://www.springframework.org/schema/tx"xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/mvchttps://www.springframework.org/schema/mvc/spring-mvc.xsd"><!--spring的配置文件,声明Service dao等工具类对象--><!-- 加载配置文件 --><context:property-placeholder location="classpath:config/jdbc.properties" /><!-- 数据库连接池 --><bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"destroy-method="close"><property name="driverClassName" value="${jdbc.driver}" /><property name="url" value="${jdbc.url}" /><property name="username" value="${jdbc.username}" /><property name="password" value="${jdbc.password}" /></bean><!--声明SqlSessionFactoryBean 创建 sqlSessionFactory--><!-- mapper配置,mybatis的SqlSessionFactoryBean --><!-- 让spring管理sqlsessionfactory 使用mybatis和spring整合包中的 --><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"><!-- 数据库连接池 --><property name="dataSource" ref="dataSource" /><!-- 加载mybatis的全局配置文件 --><property name="configLocation" value="classpath:config/mybatis-config.xml" /></bean><!--声明mybatis的扫描,创建dao对象--><!-- 配置Mapper扫描器 --><bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"><property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/><property name="basePackage" value="com.hx.dao"/></bean><!--声明service的扫描--><context:component-scan base-package="com.hx.service"/></beans>

1.7 配置MyBatis的核心文件

<?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><!--设置实体类别名--><typeAliases><package name="com.hx.domain"/></typeAliases><!--配置接口文件映射--><mappers><!--使用package要求:1、mapper文件名称和mapper接口名完全一致,包括大小写2、mapper文件和mapper接口必须在统一目录--><package name="com.hx.dao"/></mappers>
</configuration>

1.8 配置数据库

创建数据库,数据表student
表字段如下:
在这里插入图片描述

1.9 配置文件位置

在这里插入图片描述

2 编写后端代码

2.1 编写实体类

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student {private Integer sid;private String sname;private Integer sage;
}

2.2 编写Dao接口

@Mapper
public interface StudentDao {//查询所有List<Student> findAll();//新增数据int addStu(@Param("student") Student student);//删除数据int delStuById(Integer sid);//修改数据int updateStu(Student student);
}

2.3 编写Dao映射文件(resource目录下)

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hx.dao.StudentDao"><!--查询所有列表--><select id="findAll" resultType="Student">select sid, sname, sagefrom student;</select><!--新增数据--><insert id="addStu">insert into studentvalues (#{student.sid}, #{student.sname}, #{student.sage});</insert><!--删除数据--><delete id="delStuById">deletefrom studentwhere sid = #{sid}</delete><!--修改数据--><update id="updateStu" parameterType="Student">update studentset sname=#{sname},sage=#{sage}where sid = #{sid}</update>
</mapper>

2.4 编写Service接口

public interface StudentService {//查询所有List<Student> selectAll();//插入数据int insertStu(Student student);int delStuById(Integer sid);int updateStu(Student student);
}

2.5 编写ServiceImpl实现类

@Service
public class StudentServiceImpl implements StudentService {@Autowiredprivate StudentDao studentDao;@Overridepublic List<Student> selectAll() {return studentDao.findAll();}@Overridepublic int insertStu(Student student) {return studentDao.addStu(student);}@Overridepublic int delStuById(Integer sid) {return studentDao.delStuById(sid);}@Overridepublic int updateStu(Student student) {return studentDao.updateStu(student);}
}

2.6 编写Controller类

1、业务Controller

@Controller
@RequestMapping("/student")
public class StudentController {@Autowiredprivate StudentService studentService;@GetMapping("/getAll.do")public ModelAndView getAll() {List<Student> list = studentService.selectAll();ModelAndView mv = new ModelAndView();mv.addObject("list", list);mv.setViewName("listStu");return mv;}@PostMapping("/add.do")public ModelAndView saveStu(Student student) {String tips = "插入失败";ModelAndView mv = new ModelAndView();int i = studentService.insertStu(student);if (i > 0) {tips = "插入成功";}mv.addObject("data1", tips);mv.setViewName("success");return mv;}@RequestMapping("/put.do")public ModelAndView putStu(Student student) {String tips = "修改失败!";ModelAndView mv = new ModelAndView();int i = studentService.updateStu(student);if (i > 0) {tips = "修改成功";}mv.addObject("data2", tips);mv.setViewName("success");return mv;}@RequestMapping(value = "/del.do")public ModelAndView delStu(Integer sid) {String tips = "删除失败!";ModelAndView mv = new ModelAndView();int i = studentService.delStuById(sid);if (i > 0) {tips = "删除成功";}mv.addObject("data3", tips);mv.setViewName("success");return mv;}
}

2、页面相关Controller

@RestController
@RequestMapping("/index")
public class IndexController {@RequestMapping("/m1Add.do")public ModelAndView m1Add(){ModelAndView mv = new ModelAndView();mv.setViewName("add");return mv;}@RequestMapping("/m2Put.do")public ModelAndView m2Put(){ModelAndView mv = new ModelAndView();mv.setViewName("put");return mv;}@RequestMapping("/m3Del.do")public ModelAndView m3Del(){ModelAndView mv = new ModelAndView();mv.setViewName("del");return mv;}
}

2.7 代码映射文件位置

在这里插入图片描述

3 编写前端代码

3.1 编写首页index.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><title>Title</title><style>div {background-color: antiquewhite;width: 400px;height: 200px;margin: 100px auto;text-align: center;background-image: url("images/p5.jpg");background-repeat: no-repeat;}a {text-decoration: none;color: orange;}button {margin: 10px 20px;}</style>
</head>
<body>
<div><h1>功能区首页</h1><br><button><a href="/student/getAll.do">查询数据</a></button><button><a href="/index/m1Add.do">插入数据</a></button><br><button><a href="/index/m2Put.do">修改数据</a></button><button><a href="/index/m3Del.do">删除数据</a></button>
</div>
</body>
</html>

3.2 配置Tomcat

在这里插入图片描述在这里插入图片描述

3.3 webapp下配置图片

在这里插入图片描述

3.4 编写功能页面WEB-INF下

在这里插入图片描述

1 编写 listStu.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%String basePath =request.getScheme() + "://" +request.getServerName() + ":" +request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head><title>展示所有学生信息</title><style>.box1 {width: 300px;height: 400px;text-align: center;margin: 10px auto;background-image: url("/images/p3.jpg");background-repeat: no-repeat;}.box2 {width: 80px;height: 25px;text-align: center;margin: 10px auto;}</style>
</head>
<body>
<div class="box1"><table border="1px" width="300px" height="30px" align="center" cellspacing="0" cellpadding="0"><caption style="font-size: 20px">学生信息表</caption><tr bgcolor="#a9a9a9" text-align="center"><td>学号</td><td>姓名</td><td>年龄</td></tr><%--数据行--%><c:forEach items="${list}" var="stu" varStatus="s"><tr><td>${stu.sid}</td><td>${stu.sname}</td><td>${stu.sage}</td></tr></c:forEach></table><%--返回到首页--%><div class="box2"><form action="<%=basePath%>index.jsp"><input type="submit" name="返回" value="返回功能区"></form></div>
</div>
</body>
</html>

2 编写 add.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String basePath =request.getScheme() + "://" +request.getServerName() + ":" +request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head><title>新增学生信息</title><style>div {background-color: antiquewhite;width: 300px;height: 180px;margin: 100px auto;text-align: center;line-height: normal;background-image: url("/images/p1.jpg");background-repeat: no-repeat;}.box2 {width: 80px;height: 25px;text-align: center;margin: auto;}</style>
</head>
<body>
<div><h3>新增数据</h3><form action="/student/add.do" method="post">学号:<input type="text" name="sid" value=""><br>姓名:<input type="text" name="sname" value=""><br>年龄:<input type="text" name="sage" value=""><br><input type="submit" value="添加"><input type="reset" value="重置"></form><%--返回到首页--%><div class="box2"><form action="<%=basePath%>index.jsp"><input type="submit" name="返回" value="返回功能区"></form></div>
</div>
</body>
</html>

3 编写 put.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String basePath =request.getScheme() + "://" +request.getServerName() + ":" +request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head><title>修改学生信息</title><style>div {background-color: antiquewhite;width: 300px;height: 180px;margin: 100px auto;text-align: center;line-height: normal;background-image: url("/images/p4.jpg");background-repeat: no-repeat;}.box2 {width: 80px;height: 25px;text-align: center;margin: auto;}</style>
</head>
<body>
<div><h3>根据学号修改数据</h3><form action="/student/put.do" method="post">学号:<input type="text" name="sid" value=""><br>姓名:<input type="text" name="sname" value=""><br>年龄:<input type="text" name="sage" value=""><br><input type="submit" value="修改"><input type="reset" value="重置"></form><%--返回到首页--%><div class="box2"><form action="<%=basePath%>index.jsp"><input type="submit" name="返回" value="返回功能区"></form></div>
</div>
</body>
</html>

4 编写 del.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String basePath =request.getScheme() + "://" +request.getServerName() + ":" +request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head><title>删除学生信息</title><style>div {background-color: beige;width: 300px;height: 150px;margin: 100px auto;text-align: center;background-image: url("/images/p2.jpg");background-repeat: no-repeat;}.box2 {width: 80px;height: 25px;text-align: center;margin: auto;}</style>
</head>
<body>
<div><h3>根据学号删除数据</h3><form action="/student/del.do" method="get"><input type="text" placeholder="请输入学号" name="sid" value=""><input type="submit" value="删除"></form><%--返回到首页--%><div class="box2"><form action="<%=basePath%>index.jsp"><input type="submit" name="返回" value="返回功能区"></form></div>
</div>
</body>
</html>

5 编写success.jsp

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%String basePath =request.getScheme() + "://" +request.getServerName() + ":" +request.getServerPort() + request.getContextPath() + "/";
%>
<html>
<head><title>Title</title><style>.box1{width: 200px;height: 150px;background-color: lightgoldenrodyellow;margin: 0 auto;text-align: center;}</style>
</head>
<body>
<div class="box1"><div class="box2"><div>插入:${data1}</div><div>修改:${data2}</div><div>删除:${data3}</div></div><%--返回到首页--%><div><form action="<%=basePath%>index.jsp"><input type="submit" name="返回" value="返回功能区"></form></div>
</div>
</body>
</html>

4 运行访问

4.1 请求路径

首页:http://localhost:8080
在这里插入图片描述

4.2 增删改查界面

  • 查询功能
    在这里插入图片描述
  • 新增功能
    在这里插入图片描述
  • 修改功能
    在这里插入图片描述
  • 删除功能
    在这里插入图片描述

4.3 项目源代码

https://gitee.com/allureyu/ssm__xml.git

以上纯属个人一手编写,欢迎指教,不喜勿喷!

相关文章:

SSM整合(XML方式)

文章目录 SSM整合之后xml方式1 系统环境1.1 软件环境1.2 项目环境1.3 配置web.xml1.4 配置jdbc.properties文件1.5 配置SpringMVC核心文件1.6 配置Spring的核心文件1.7 配置MyBatis的核心文件1.8 配置数据库1.9 配置文件位置 2 编写后端代码2.1 编写实体类2.2 编写Dao接口2.3 编…...

学习Vue:列表渲染(v-for)

在 Vue.js 中&#xff0c;实现动态列表的显示是非常常见的需求。为了达到这个目的&#xff0c;Vue 提供了 v-for 指令&#xff0c;它允许您迭代一个数组或对象&#xff0c;将其元素渲染为列表。然而&#xff0c;在使用 v-for 时&#xff0c;key 属性的设置也非常重要&#xff0…...

使用巴特沃兹滤波器的1D零相位频率滤波研究(Matlab代码实现)

&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; &#x1f3c6;博主优势&#xff1a;&#x1f31e;&#x1f31e;&#x1f31e;博客内容尽量做到思维缜密&#xff0c;逻辑清晰&#xff0c;为了方便读者。 ⛳️座右铭&a…...

ubuntu18.04安装cuda

卸载之前安装的驱动 sudo apt-get purge nvidia*安装驱动 方法1&#xff1a; 查看显卡适配的NVIDIA的驱动 ubuntu-drivers devices安装recommend推荐的版本 sudo apt-get install nvidia-driver-455方法2&#xff1a; 或者直接使用下面命令安装 sudo ubuntu-drivers au…...

【MFC】09.MFC视图-笔记

MFC视图窗口&#xff1a;CView类 显示数据/画面 我们之前的绘图消息&#xff0c;都是在框架类上画出来的 视图窗口就覆盖在框架窗口上 视图窗口本质上也是窗口&#xff0c;只是和框架窗口风格不同 CView类也继承于CWnd类 CView也能处理消息&#xff0c;因为它继承于CWnd类…...

【字节跳动青训营】后端笔记整理-2 | Go实践记录:猜谜游戏,在线词典,Socks5代理服务器

**本人是第六届字节跳动青训营&#xff08;后端组&#xff09;的成员。本文由博主本人整理自该营的日常学习实践&#xff0c;首发于稀土掘金&#xff1a;&#x1f517;Go实践记录&#xff1a;猜谜游戏&#xff0c;在线词典&#xff0c;Socks5代理服务器 | 青训营 我的go开发环境…...

GPT的第一个创作

嗨&#xff0c;大家好&#xff0c;我是赖兴泳&#xff01;今天&#xff0c;我要和大家聊一聊前端开发&#xff0c;就像我用音符创造音乐一样&#xff0c;前端开发也是创造美丽的用户界面的过程。 前端开发是构建网站和应用程序用户界面的关键部分。就像音乐家需要精心编排音符…...

Spring Boot 获取前端参数

Spring Boot 获取前端参数 在开发 Web 应用程序时&#xff0c;前端参数是非常重要的。Spring Boot 提供了多种方法来获取前端参数&#xff0c;本文将介绍其中的一些常用方法。 1. 使用 RequestParam 注解 RequestParam 注解是 Spring MVC 提供的一种常用方式&#xff0c;用于…...

java应用运行在docker,并且其他组件也在docker

docker启动redis容器 # create redis docker run -d --name redis-container -p 6379:6379 redis:latest创建java 应用 dockerfile FROM openjdk:17##Pre-create related directories RUN mkdir -p /data/etax/ms-app WORKDIR /data/etax/ms-appEXPOSE 10133 COPY ./target…...

Java真实面试题,offer已到手

关于学习 在黑马程序员刚刚开始的时候学习尽头非常足&#xff0c;到后面逐渐失去了一些兴趣&#xff0c;以至于后面上课会出现走神等问题&#xff0c;但是毕业时后悔晚矣。等到开始学习项目一的时候&#xff0c;思路总会比别人慢一些&#xff0c;不看讲义写不出来代码。 建议…...

在序列化、反序列化下如何保持单例(Singleton)模式

1、序列化、反序列化 在 Java 中&#xff0c;当一个对象被序列化后再被反序列化&#xff0c;通常情况下会创建一个新的对象实例。这是因为序列化将对象的状态保存到字节流中&#xff0c;而反序列化则是将字节流重新转化为对象。在这个过程中&#xff0c;通常会使用类的构造函数…...

【数据结构】二叉树篇|超清晰图解和详解:二叉树的最近公共祖先

博主简介&#xff1a;努力学习的22级计算机科学与技术本科生一枚&#x1f338;博主主页&#xff1a; 是瑶瑶子啦每日一言&#x1f33c;: 你不能要求一片海洋&#xff0c;没有风暴&#xff0c;那不是海洋&#xff0c;是泥塘——毕淑敏 目录 一、题目二、题解三、代码 一、题目 …...

android ndk clang交叉编译ffmpeg动态库踩坑

1.ffmpeg默认使用gcc编译&#xff0c;在android上无法使用&#xff0c;否则各种报错&#xff0c;所以要用ndk的clang编译 2.下载ffmpeg源码 修改configure文件&#xff0c;增加命令 cross_prefix_clang 修改以下命令 cc_default"${cross_prefix}${cc_default}" cxx…...

简单记录牛客top101算法题(初级题C语言实现)BM24 二叉树的中序遍历 BM28 二叉树的最大深度 BM29 二叉树中和为某一值的路径

1. BM24 二叉树的中序/后续遍历 要求&#xff1a;给定一个二叉树的根节点root&#xff0c;返回它的中序遍历结果。                          输入&#xff1a;{1,2,#,#,3} 返回值&#xff1a;[2,3,1]1.1 自己的整体思路&#xff08;与二叉树的前序遍…...

前后端分离------后端创建笔记(05)用户列表查询接口(上)

本文章转载于【SpringBootVue】全网最简单但实用的前后端分离项目实战笔记 - 前端_大菜007的博客-CSDN博客 仅用于学习和讨论&#xff0c;如有侵权请联系 源码&#xff1a;https://gitee.com/green_vegetables/x-admin-project.git 素材&#xff1a;https://pan.baidu.com/s/…...

性能测试|App性能测试需要关注的指标

一、Android客户端性能测试常见指标&#xff1a; 1、内存 2、CPU 3、流量 4、电量 5、启动速度 6、滑动速度、界面切换速度 7、与服务器交互的网络速度 二、预期标准指定原则 1、分析竞争对手的产品&#xff0c;所有指标要强于竞品 2、产品经理给出的预期性能指标数据…...

Termux SFTP 进行远程文件传输

文章目录 1. 安装openSSH2. 安装cpolar3. 远程SFTP连接配置4. 远程SFTP访问4. 配置固定远程连接地址 SFTP&#xff08;SSH File Transfer Protocol&#xff09;是一种基于SSH&#xff08;Secure Shell&#xff09;安全协议的文件传输协议。与FTP协议相比&#xff0c;SFTP使用了…...

Sqlite3简介

SQLite3 简介 SQLite3 是一种轻量级的嵌入式数据库引擎&#xff0c;被广泛应用于各种应用程序中&#xff0c;包括移动设备、桌面应用程序和嵌入式系统。它以其简单、高效和零配置的特点而受到开发者的喜爱。 以下是 SQLite3 的一些重要特点&#xff1a; 嵌入式数据库引擎&…...

K8S调度

K8S调度 一、List-Watch 机制 controller-manager、scheduler、kubelet 通过 List-Watch 机制监听 apiserver 发出的事件&#xff0c;apiserver 通过 List-Watch 机制监听 etcd 发出的事件1.scheduler 的调度策略 预选策略/预算策略&#xff1a;通过调度算法过滤掉不满足条件…...

vue+element多层表单校验prop和rules

核心点&#xff1a;外层循环是item和index&#xff0c;内层循环是item2和index2 如果都是定义的同一个属性名 外层循环得写:prop"block.index.numerical" 同理内层循环就得写:prop"objectSpecs. index2 .numerical" 校验函数方法 :rules"getRules(it…...

使用docker在3台服务器上搭建基于redis 6.x的一主两从三台均是哨兵模式

一、环境及版本说明 如果服务器已经安装了docker,则忽略此步骤,如果没有安装,则可以按照一下方式安装: 1. 在线安装(有互联网环境): 请看我这篇文章 传送阵>> 点我查看 2. 离线安装(内网环境):请看我这篇文章 传送阵>> 点我查看 说明&#xff1a;假设每台服务器已…...

谷歌浏览器插件

项目中有时候会用到插件 sync-cookie-extension1.0.0&#xff1a;开发环境同步测试 cookie 至 localhost&#xff0c;便于本地请求服务携带 cookie 参考地址&#xff1a;https://juejin.cn/post/7139354571712757767 里面有源码下载下来&#xff0c;加在到扩展即可使用FeHelp…...

【kafka】Golang实现分布式Masscan任务调度系统

要求&#xff1a; 输出两个程序&#xff0c;一个命令行程序&#xff08;命令行参数用flag&#xff09;和一个服务端程序。 命令行程序支持通过命令行参数配置下发IP或IP段、端口、扫描带宽&#xff0c;然后将消息推送到kafka里面。 服务端程序&#xff1a; 从kafka消费者接收…...

AI Agent与Agentic AI:原理、应用、挑战与未来展望

文章目录 一、引言二、AI Agent与Agentic AI的兴起2.1 技术契机与生态成熟2.2 Agent的定义与特征2.3 Agent的发展历程 三、AI Agent的核心技术栈解密3.1 感知模块代码示例&#xff1a;使用Python和OpenCV进行图像识别 3.2 认知与决策模块代码示例&#xff1a;使用OpenAI GPT-3进…...

23-Oracle 23 ai 区块链表(Blockchain Table)

小伙伴有没有在金融强合规的领域中遇见&#xff0c;必须要保持数据不可变&#xff0c;管理员都无法修改和留痕的要求。比如医疗的电子病历中&#xff0c;影像检查检验结果不可篡改行的&#xff0c;药品追溯过程中数据只可插入无法删除的特性需求&#xff1b;登录日志、修改日志…...

最新SpringBoot+SpringCloud+Nacos微服务框架分享

文章目录 前言一、服务规划二、架构核心1.cloud的pom2.gateway的异常handler3.gateway的filter4、admin的pom5、admin的登录核心 三、code-helper分享总结 前言 最近有个活蛮赶的&#xff0c;根据Excel列的需求预估的工时直接打骨折&#xff0c;不要问我为什么&#xff0c;主要…...

基础测试工具使用经验

背景 vtune&#xff0c;perf, nsight system等基础测试工具&#xff0c;都是用过的&#xff0c;但是没有记录&#xff0c;都逐渐忘了。所以写这篇博客总结记录一下&#xff0c;只要以后发现新的用法&#xff0c;就记得来编辑补充一下 perf 比较基础的用法&#xff1a; 先改这…...

[10-3]软件I2C读写MPU6050 江协科技学习笔记(16个知识点)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16...

【Zephyr 系列 10】实战项目:打造一个蓝牙传感器终端 + 网关系统(完整架构与全栈实现)

🧠关键词:Zephyr、BLE、终端、网关、广播、连接、传感器、数据采集、低功耗、系统集成 📌目标读者:希望基于 Zephyr 构建 BLE 系统架构、实现终端与网关协作、具备产品交付能力的开发者 📊篇幅字数:约 5200 字 ✨ 项目总览 在物联网实际项目中,**“终端 + 网关”**是…...

WEB3全栈开发——面试专业技能点P2智能合约开发(Solidity)

一、Solidity合约开发 下面是 Solidity 合约开发 的概念、代码示例及讲解&#xff0c;适合用作学习或写简历项目背景说明。 &#x1f9e0; 一、概念简介&#xff1a;Solidity 合约开发 Solidity 是一种专门为 以太坊&#xff08;Ethereum&#xff09;平台编写智能合约的高级编…...