58 简单学生管理系统【项目需求、数据库搭建、项目搭建、功能实现(注册功能、登录功能完善验证码功能(Session-会话对象))】

news2024/9/20 9:09:59

简单学生管理系统

项目需求

项目需求分析

数据库搭建

数据库建表

数据库建表

导数据库sql

了解

导数据库sql

项目搭建

导包,基础页面,实体类,工具类

项目基本搭建.

基础页面

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
  <h1>欢迎页面</h1>

  <a href="login.html">登录</a>
  <a href="register.html">注册</a>

</body>
</html>

实体类

public class User {

    private String username;
    private String password;
    private String name;
    private String sex;
    private int age;
    ...
    
}
public class Student extends User{

    private String hobbies;
    ...
}
public class Teacher extends User{

    private int courseId;
	...
}
public class Course {

    private int id;
    private String name;
    ...
}

工具类

/**
 * 数据库工具类
 */
public class DBUtils {

    private static DruidDataSource pool;
    private static ThreadLocal<Connection> local;

    static{
        Properties properties = new Properties();
        try {
            properties.load(DBUtils.class.getClassLoader().getResourceAsStream("DBConfig.properties"));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        String driverClassName = properties.getProperty("driverClassName");
        String url = properties.getProperty("url");
        String username = properties.getProperty("username");
        String password = properties.getProperty("password");
        int maxActive = Integer.parseInt(properties.getProperty("maxActive"));

        //初始化数据库连接池
        pool = new DruidDataSource();

        //设置参数
        pool.setDriverClassName(driverClassName);
        pool.setUrl(url);
        pool.setUsername(username);
        pool.setPassword(password);
        pool.setMaxActive(maxActive);

        local = new ThreadLocal<>();
    }

    /**
     * 获取连接对象
     */
    public static Connection getConnection() throws SQLException {
        Connection connection = local.get();//获取当前线程的Connection对象
        if(connection == null){
            connection = pool.getConnection();//获取数据库连接池里的连接对象
            local.set(connection);//将Connection对象添加到local中
        }
        return connection;
    }

    /**
     * 关闭资源
     */
    public static void close(Connection connection, Statement statement, ResultSet resultSet){
        if(resultSet != null){
            try {
                resultSet.close();
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }
        }
        if(statement != null){
            try {
                statement.close();
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }
        }
        if(connection != null){
            try {
                if(connection.getAutoCommit()){
                    connection.close();
                    local.set(null);
                }
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }
        }
    }

    /**
     * 开启事务
     */
    public static void startTransaction() throws SQLException {
        Connection connection = getConnection();
        connection.setAutoCommit(false);
    }

    /**
     * 提交事务
     */
    public static void commit() throws SQLException {
        Connection connection = local.get();
        if(connection != null){
            connection.commit();
            connection.close();
            local.set(null);
        }
    }

    public static void rollback() throws SQLException {
        Connection connection = local.get();
        if(connection != null){
            connection.rollback();
            connection.close();
            local.set(null);
        }
    }

    /**
     * 更新数据(添加、删除、修改)
     */
    public static int commonUpdate(String sql,Object... params) throws SQLException {
        Connection connection = null;
        PreparedStatement statement = null;
        try {
            connection = getConnection();
            statement = connection.prepareStatement(sql);
            paramHandler(statement,params);
            int num = statement.executeUpdate();
            return num;
        }finally {
            close(connection,statement,null);
        }
    }

    /**
     * 添加数据 - 主键回填(主键是int类型可以返回)
     */
    public static int commonInsert(String sql,Object... params) throws SQLException {
        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet resultSet = null;
        try {
            connection = getConnection();
            statement = connection.prepareStatement(sql,PreparedStatement.RETURN_GENERATED_KEYS);
            paramHandler(statement,params);
            statement.executeUpdate();

            resultSet = statement.getGeneratedKeys();
            int primaryKey = 0;
            if(resultSet.next()){
                primaryKey = resultSet.getInt(1);
            }
            return primaryKey;
        }finally {
            close(connection,statement,resultSet);
        }
    }

    /**
     * 查询多个数据
     */
    public static <T> List<T> commonQueryList(Class<T> clazz,String sql, Object... params) throws SQLException, InstantiationException, IllegalAccessException {

        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet resultSet = null;

        try {
            connection = getConnection();
            statement = connection.prepareStatement(sql);
            paramHandler(statement,params);
            resultSet = statement.executeQuery();

            //获取表数据对象
            ResultSetMetaData metaData = resultSet.getMetaData();
            //获取字段个数
            int count = metaData.getColumnCount();

            List<T> list = new ArrayList<>();

            while(resultSet.next()){

                T t = clazz.newInstance();

                //获取字段名及数据
                for (int i = 1; i <= count; i++) {
                    String fieldName = metaData.getColumnName(i);
                    Object fieldVal = resultSet.getObject(fieldName);
                    setField(t,fieldName,fieldVal);
                }
                list.add(t);
            }
            return list;
        } finally {
            DBUtils.close(connection,statement,resultSet);
        }
    }

    /**
     * 查询单个数据
     */
    public static <T> T commonQueryObj(Class<T> clazz,String sql, Object... params) throws SQLException, InstantiationException, IllegalAccessException {

        Connection connection = null;
        PreparedStatement statement = null;
        ResultSet resultSet = null;

        try {
            connection = getConnection();
            statement = connection.prepareStatement(sql);
            paramHandler(statement,params);
            resultSet = statement.executeQuery();

            //获取表数据对象
            ResultSetMetaData metaData = resultSet.getMetaData();
            //获取字段个数
            int count = metaData.getColumnCount();

            if(resultSet.next()){

                T t = clazz.newInstance();

                //获取字段名及数据
                for (int i = 1; i <= count; i++) {
                    String fieldName = metaData.getColumnName(i);
                    Object fieldVal = resultSet.getObject(fieldName);
                    setField(t,fieldName,fieldVal);
                }
                return t;
            }
        } finally {
            DBUtils.close(connection,statement,resultSet);
        }
        return null;
    }

    /**
     * 处理statement对象参数数据的处理器
     */
    private static void paramHandler(PreparedStatement statement,Object... params) throws SQLException {
        for (int i = 0; i < params.length; i++) {
            statement.setObject(i+1,params[i]);
        }
    }

    /**
     * 获取当前类及其父类的属性对象
     * @param clazz class对象
     * @param name 属性名
     * @return 属性对象
     */
    private static Field getField(Class<?> clazz,String name){

        for(Class<?> c = clazz;c != null;c = c.getSuperclass()){
            try {
                Field field = c.getDeclaredField(name);
                return field;
            } catch (NoSuchFieldException e) {
            } catch (SecurityException e) {
            }
        }
        return null;
    }

    /**
     * 设置对象中的属性
     * @param obj 对象
     * @param name 属性名
     * @param value 属性值
     */
    private static void setField(Object obj,String name,Object value){

        Field field = getField(obj.getClass(), name);
        if(field != null){
            field.setAccessible(true);
            try {
                field.set(obj, value);
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
    }
}

功能实现

1.注册功能(简单实现)

注册的是学生,老师账号一般都由管理员分配
注册成功

html页面
<body>
    <h1>注册页面</h1>

    <form action="RegisterServlet" method="post">

        账号:<input type="text" name="username"/><br/>
        密码:<input type="password" name="password"/><br/>
        姓名:<input type="text" name="name"/><br/>
        年龄:<input type="text" name="age"/><br/>
        性别:
        <input type="radio" name="sex" value="man" checked="checked"/><input type="radio" name="sex" value="woman"/><br/>
        爱好:
        <input type="checkbox" name="hobbies" value="football"/>足球
        <input type="checkbox" name="hobbies" value="basketball"/>篮球
        <input type="checkbox" name="hobbies" value="shop"/>购物
        <br/>

        <input type="submit" value="注册"/>
        <input type="button" value="返回" onclick="goWelcome()"/>
    </form>

    <script type="text/javascript">
        function goWelcome(){
            window.location = "welcome.html";
        }
    </script>
</body>
RegisterServlet
  1. 设置请求、响应编码格式
  2. 获取请求中的数据
  3. 通过username查询数据库中的学生对象
  4. 通过学生对象进行判断

​ 允许注册,将数据插入到学生表中,利用重定向跳转到登录页面

​ 不允许注册,利用重定向跳转到注册页面

@WebServlet("/RegisterServlet")
public class RegisterServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //设置请求、响应编码格式
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");

        //获取请求中的数据
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        String name = request.getParameter("name");
        String sex = request.getParameter("sex");
        String age = request.getParameter("age");
        String[] hobbies = request.getParameterValues("hobbies");

        //通过username查询数据库中的学生对象
        Student student = null;
        try {
            student = DBUtils.commonQueryObj(Student.class, "select * from student where username=?", username);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        } catch (InstantiationException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }

        if(student == null){//允许注册

            //将数据插入到学生表中
            try {
                DBUtils.commonUpdate("insert into student(username,password,name,sex,age,hobbies) values(?,?,?,?,?,?)",username,password,name,sex,age, StringUtils.handleArray(hobbies));
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }

            //利用重定向跳转到登录页面
            response.sendRedirect("login.html");
        }else{//不允许注册

            //利用重定向跳转到注册页面
            response.sendRedirect("register.html");
        }

    }
}
新增工具类handleArray

处理数组,对于学生的爱好是数组

public class StringUtils {

    public static String handleArray(Object[] os){

        StringBuffer sb = new StringBuffer();
		//利用反射实现
        for (int i = 0; i<Array.getLength(os);i++){

            if(i != 0){//不是第一次循环,也就是后面的循环才加逗号,注意先后顺序
                sb.append(",");
            }

            Object element = Array.get(os, i);
            sb.append(element);

        }
        
//        for (Object element : os) {
//            if(sb.length() !=0){
//                sb.append(",");
//            }
//            sb.append(element);
//        }
        return sb.toString();
    }
}

2.登录功能(只对账号、密码做了判断)

登录功能_账号密码角色
登录功能_账号密码角色

html页面

注意设置刷新验证码的函数

<body>
    <h1>登录页面</h1>

    <form action="LoginServlet" method="post">

        账号:<input type="text" name="username"/><br/>
        密码:<input type="password" name="password"/><br/>
        验证码:<input type="text" name="userCode"/><img src="CodeServlet" width="120px" height="30px" "><a href="#" ">刷新</a><br/>
        记住我:<input type="checkbox" name="rememberMe"/><br/>
        角色:
            <select name="role">
                <option value="student">学生</option>
                <option value="teacher">老师</option>
            </select>
            <br/>
        <input type="submit" value="登录"/>
        <input type="button" value="返回" onclick="goWelcome()"/>
    </form>

    <script type="text/javascript">
        function goWelcome(){
            window.location = "welcome.html";
        }
    </script>
</body>
<body>
  <h1>详情页面</h1>
</body>
LoginServlet
  1. 设置请求、响应编码格式
  2. 获取请求中的数据
  3. 通过username、password查询数据库中的用户对象
  4. 通过用户对象进行判断

​ 登录成功,利用重定向跳转到详情页面

​ 登录失败 – 账号或密码错误,利用重定向跳转到登录页面

@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //设置请求、响应编码格式
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");

        //获取请求中的数据
        String username = request.getParameter("username");
        String password = request.getParameter("password");
        String userCode = request.getParameter("userCode");
        String rememberMe = request.getParameter("rememberMe");
        String role = request.getParameter("role");
			//方法1
//        String sysCode = CodeServlet.sysCode;
        	//完善的方法
        //从Session对象中获取系统的验证码
         String sysCode = (String) request.getSession().getAttribute("sysCode");
        //equalsIgnoreCase不区分大小写比较
         if(sysCode.equalsIgnoreCase(userCode)){//验证码正确
			
        	//通过username、password查询数据库中的用户对象
            User user = null;
            try {
                if("student".equals(role)){
                    user = DBUtils.commonQueryObj(Student.class, "select * from student where username=? and password=?", username, password);
                }else if("teacher".equals(role)){
                    user = DBUtils.commonQueryObj(Student.class, "select * from teacher where username=? and password=?", username, password);
                }
            } catch (SQLException e) {
                throw new RuntimeException(e);
            }

            if(user != null){//登录成功
                //利用重定向跳转到详情页面
                response.sendRedirect("index.html");
            }else{//登录失败 -- 账号或密码错误
                //利用重定向跳转到登录页面
                response.sendRedirect("login.html");
            }

          }else{//登录失败 - 验证码错误
              response.sendRedirect("login.html");
         }
    }
}

3.绘制验证码

登录验证码实现
登录验证码实现

CodeServlet

1.创建画布(前提定义宽高)

2.通过画布获取画笔

3.设置背景色 – 填充矩形【利用画笔】

4.设置验证码

​ 创建验证码数字数组、颜色数组

​ 利用随机数进行获取随机下标从而获取随机数字和颜色

​ 设置随机颜色

​ 设置字体(字体,样式,大小)

​ 设置单个验证码

​ StringBffer拼接成验证码

​ 设置干扰线

6.ImageIO将画布以jpg形式的文件传出给客户端

@WebServlet("/CodeServlet")
public class CodeServlet extends HttpServlet {
	//方法1:public static String sysCode;
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //设置宽高的变量
        int width = 120;
        int height = 30;

        //创建画布
        BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);

        //获取画笔
        Graphics graphics = image.getGraphics();

        //设置背景色 -- 填充矩形
        graphics.setColor(Color.BLUE);
        graphics.fillRect(0,0,width,height);

        //设置验证码
        Random random = new Random();
        String[] codes = {"A","B","C","D","E","F","G","H","J","K","M","N","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9"};
        Color[] colors = {Color.CYAN,Color.BLACK,Color.GREEN,Color.PINK,Color.WHITE,Color.RED,Color.ORANGE};

        StringBuffer sb = new StringBuffer();

        for (int i = 0; i < 4; i++) {

            String randomCode = codes[random.nextInt(codes.length)];
            Color randomColor = colors[random.nextInt(colors.length)];

            graphics.setColor(randomColor);//设置随机颜色
            graphics.setFont(new Font("宋体",Font.BOLD,20+random.nextInt(10)));//设置字体(字体,样式,大小)
            graphics.drawString(randomCode,20+i*25,15+random.nextInt(10));//设置单个验证码

            sb.append(randomCode);
        }
		
        //方法1:sysCode = sb.toString();
        
        //完善的方法
        //将系统验证码设置到Session对象中(会话对象)
        HttpSession session = request.getSession();//获取请求里的JSESSIONID(客户端Cookie里的数据),如果没有就创建Session对象,如果有就从Session容器中获取会话对象
        session.setAttribute("sysCode",sb.toString());

        //设置干扰线
        graphics.setColor(Color.YELLOW);
        for (int i = 0; i < 3; i++) {
            graphics.drawLine(random.nextInt(width),random.nextInt(height),random.nextInt(width),random.nextInt(height));//绘制直线(x1,y1,x2,y2) -> 两点为一线
        }

        
        //将画布以jpg形式的文件传出给客户端
        ImageIO.write(image,"jpg",response.getOutputStream());
    }
}

4.完善验证码功能(Session-会话对象 )*

Session

简单理解
session理解图

注意:浏览器不要禁用Cookie,JSESSIONID就不会保存

登录功能和绘制验证码的中描述未提及的内容

验证码:

方法1:

设置静态成员变量
public static String sysCode;
定义系统验证码
sysCode = sb.toString();

完善:

何时创建Session对象:要用到Session时才会创建

HttpSession session = request.getSession();

将系统验证码设置到Session对象中(会话对象)

session.setAttribute("sysCode",sb.toString());

ctrl+点击查看—底层:注意键和值分别的类型,Object意味着可以存对象

void setAttribute(String var1, Object var2);

添加登录验证码判断

方法1:

String sysCode = CodeServlet.sysCode;

共享变量验证码时登录情况
出现问题:当新开浏览器就会刷新验证码,就以前的验证码就用不了
共享变量验证码时登录情况
没有对应的JESSIONID没有cookie

完善:

从Session对象中获取系统的验证码,类型不一致注意强转

String sysCode = (String) request.getSession().getAttribute("sysCode");

equalsIgnoreCase不区分大小写比较系统验证码和用户验证码,包含了用户对象的判断,意味着登录验证先验证验证码

 if(sysCode.equalsIgnoreCase(userCode)){
 }else{}

获取Session对象解决问题
获取Session对象解决问题
浏览器有cookie中存有对应的JESSIONID有cookie

修改register.html

添加刷新验证码的函数和绑定

    验证码:<input type="text" name="userCode"/><img src="CodeServlet" width="120px" height="30px" onclick="refresh()"><a href="#" onclick="refresh()">刷新</a><br/>

	        <script type="text/javascript">


            img = document.getElementsByTagName("img")[0];
            function refresh(){
                img.src = "CodeServlet?" + new Date();
            }
        </script>
    

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1970704.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

深入实践,浅谈EHS管理的智能化转型

随着人工智能、大数据、云计算等先进技术的飞速发展&#xff0c;EHS管理体系与管理软件的融合正步入一个全新的智能化时代。这一转型不仅进一步提升了EHS管理的效率和精准度&#xff0c;还为企业带来了前所未有的管理视野和决策支持。 一、创新驱动&#xff0c;深化EHS管理的智…

深入探讨Google谷歌助力孟加拉slots游戏广告市场前景

深入探讨Google谷歌助力孟加拉slots游戏广告市场前景 在深入探讨孟加拉游戏广告投放于Google谷歌平台的优势时&#xff0c;不得不提及其强大的数据分析与精准定位能力。谷歌广告平台拥有全球领先的数据处理技术&#xff0c;能够基于用户的搜索历史、浏览行为、地理位置等多维度…

C语言程序设计24

《C程序设计教程&#xff08;第四版&#xff09;——谭浩强》 习题2.1 求下列算数表达式的值 &#xff08;1&#xff09;xa%3*(int)(xy)%2/4 设x2.5,a7,y4.7 (2)(float)(ab)/2(int)x%(int)y 设 a2,b3,x3.5,y2.5 代码&#xff08;1&#xff09;&#xff1a;…

贪心系列专题篇三

目录 单调递增的数字 坏了的计算器 合并区间 无重叠区间 用最少数量的箭 声明&#xff1a;接下来主要使用贪心法来解决问题&#xff01;&#xff01;&#xff01; 单调递增的数字 题目 思路 如果我们遍历整个数组&#xff0c;然后对每个数k从[k,0]依次遍历寻找“单调递…

人力资源专家推荐:2024年十大HR软件

本篇文章介绍了以下人力资源管理工具&#xff1a;Moka、北森云计算、友人才、人瑞人才、Zoho People、金蝶之家、Gusto、Workday HCM、Namely、UKG Pro。 在选择合适的人力资源软件时&#xff0c;许多企业常常面临各种挑战&#xff0c;例如如何确保软件功能全面、用户体验良好&…

WinForm中使用Bitmap元素处理图像

前言 这个Bitmap元素在我们处理图像显示相关时&#xff0c;它的身影就可以见到了。官方术语&#xff1a;封装 GDI 位图&#xff0c;此位图由图形图像及其属性的像素数据组成。 Bitmap 是用于处理由像素数据定义的图像的对象。操作对象最重要的两个方法GetPixel和SetPixel。 一…

vscode+cmake+msys2工具链配置

1、msys2下载编译器和cmake工具 pacman -S mingw-w64-x86_64-toolchain pacman -S mingw-w64-x86_64-cmaketoolchain包中包含很多不必要的包&#xff0c;应该可以指定具体的工具g&#xff0c;gcc&#xff0c;mingw32-make的下载&#xff0c;详细命令请自行搜索。 2、将 msys2…

前端面试宝典【HTML篇】【3】

欢迎来到《前端面试宝典》,这里是你通往互联网大厂的专属通道,专为渴望在前端领域大放异彩的你量身定制。通过本专栏的学习,无论是一线大厂还是初创企业的面试,都能自信满满地展现你的实力。 核心特色: 独家实战案例:每一期专栏都将深入剖析真实的前端面试案例,从基础知…

开源=最强大模型!Llama3.1发布,405B超越闭源GPT-4o,扎克伯格:分水岭时刻

刚刚&#xff0c;LIama 3.1正式发布&#xff0c;登上大模型王座&#xff01; 在150多个基准测试集中&#xff0c;405B版本的表现追平甚至超越了现有SOTA模型GPT-4o和Claude 3.5 Sonnet。 也就是说&#xff0c;这次&#xff0c;最强开源模型即最强模型。 在此之前&#xff0c;…

零基础入门转录组数据分析——机器学习算法之xgboost(筛选特征基因)

零基础入门转录组数据分析——机器学习算法之xgboost&#xff08;筛选特征基因&#xff09; 目录 零基础入门转录组数据分析——机器学习算法之xgboost&#xff08;筛选特征基因&#xff09;1. xgboost基础知识2. xgboost&#xff08;Rstudio&#xff09;——代码实操2. 1 数据…

第N高的薪水 [sql]

CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT BEGINset N N - 1;RETURN (# Write your MySQL query statement below.select distinct salary from Employee order by salary desc limit 1 offset N); END

VSCode使用conda虚拟环境配置

如何解决CondaError: Run ‘conda init‘ before ‘conda activate‘_condaerror: run conda init before conda activat-CSDN博客 首先检查自己的anaconda是否是添加到整个的环境变量里了 打开cmd如果conda和python都能够识别那么就是配置成功了 然后看插件是否安装&#xf…

1个惊艳的Python项目火出圈,已开源,10K stars!

本次分享一个Python工具Taipy:“To build data & AI web applications in no time”。 Taipy专为数据科学家和机器学习工程师设计,用于构建数据和AI的Web应用程序。 快速构建可投入生产的Web应用程序。无需学习HTML、CSS、JS等新前端语言,只需使用Python。专注于数据和A…

抖音短视频矩阵系统优势:为何选择短视频矩阵系统?

1. 抖音短视频矩阵系统 抖音短视频矩阵系统&#xff0c;是指通过抖音平台&#xff0c;以矩阵的形式进行短视频创作、发布和传播的一种模式。它以多样化的内容、丰富的表现形式、高度的专业化和协同性&#xff0c;吸引了大量用户和创作者的关注。 2. 短视频矩阵系统的优势 2.…

jdk和tomcat的环境配置以及使用nginx代理tomcat来实现负载均衡

目录 1.jdk环境配置 1.jdk下载 2.解压 3.将jdk-22.2移动到指定目录/usr/local/jdk22/下 4.配置文件 5.运行profile 6.测试 2.tomcat环境配置 1.下载tomcat 2.解压 3.将解压后的文件移动指定目录 4.启动tomcat 5.查看端口确定是否确定成功 6.测试 7.tomcat目录 1…

<数据集>航拍人车识别数据集<目标检测>

数据集格式&#xff1a;VOCYOLO格式 图片数量&#xff1a;9695张 标注数量(xml文件个数)&#xff1a;9695 标注数量(txt文件个数)&#xff1a;9695 标注类别数&#xff1a;4 标注类别名称&#xff1a;[car, pedestrian, truck, bus] 序号类别名称图片数框数1car923525710…

GIT如何将远程指定分支的指定提交拉回到本地分支

一、当前我的代码在这个提交&#xff0c;但可以看到远程仓库上面还有两次新的提交 二、现在我想让我本次的代码更新到最上面这个最新的提交 三、输入git fetch命令获取远程分支的最新提交信息。 四、输入 git log origin/<remote_branch_name>查看并找到想要更新的指定提…

Reat hook开源库推荐

Channelwill Hooks 安装 npm i channelwill/hooks # or yarn add channelwill/hooks # or pnpm add channelwill/hooksAPI 文档 工具 Hooks useArrayComparison: 比较两个数组的变化。useCommunication: 处理组件之间的通信。useCurrencyConverter: 货币转换工具。useCurre…

【SRC挖掘】众测下的SQL注入挖掘案例

众测下的SQL注入挖掘 众测下的SQL注入挖掘0x01原理&#xff1a;0x02测试方法&#xff1a;常用手法&#xff1a;注入存在点&#xff1a; 0x03案例&#xff1a;总结 众测下的SQL注入挖掘 0x01原理&#xff1a; sql注入的原理在这里就不在详细介绍了&#xff0c;我相信大多数师傅…

MySQL数据库 外键默认约束和action 基础知识【2】推荐

数据库就是储存和管理数据的仓库&#xff0c;对数据进行增删改查操作&#xff0c;其本质是一个软件。MySQL就是一种开源的关系型数库&#xff0c;也是最受欢迎的数据库之一&#xff0c;今天对MySQL数据的基础知识做了整理&#xff0c;方便自己查看&#xff0c;也欢迎正在学习My…