SSM三层架构之间整合

2023-11-15

一、前言
之前学习ssm框架的时候都是每个框架独立分散的系统性学习,对于框架的整体,总结效果不太好,后来看了黑马视频教程有个老师的思路给了我比较大的启发,以spring为中心,去整合springmvc、mybatis,无论是搭建环境,还是理解整体ssm思路都是比较不错的选择

二、SSM整合步骤介绍(本文通过注解+配置实现)
在这里插入图片描述

首先进行整合的前提是确保各自独立都能够正常运行,然后在互相整合横向扩展

1、在domain包下定义一个Account的Javabean类用于交互数据

public class Account implements Serializable {
    private Integer id;
    private String name;
    private Integer salary;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSalary() {
        return salary;
    }

    public void setSalary(Integer salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "Account{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", salary=" + salary +
                '}';
    }
}

2、先在业务层定义IAccountService接口及AccountServiceImpl接口实现类

@Service
public interface IAccountService {

    //查询用户
    List<Account> findAccount();

    //删除用户
    void delAccount(Account account);

    //添加用户
    void addAccount(Account account);

}

@Service("accountService")
public class AccountServiceImpl implements IAccountService {

    @Autowired
    private AccountDao accountDao;

    @Override
    public List<Account> findAccount(){

        System.out.println("业务层findAccount方法执行了");
        return accountDao.findAccount();
    }

    @Override
    public void delAccount(Account account) {
        System.out.println("业务层delAccount方法执行了");
        accountDao.delAccount(account);
    }

    @Override
    public void addAccount(Account account) {
        System.out.println("业务层addAccount方法执行了");
        accountDao.addAccount(account);
    }
}


3、在dao层定义AccountDao用于跟数据库进行交互,得到结果

@Repository
public interface AccountDao {

    //查询用户
    @Select("select * from user_info")
    List<Account> findAccount();

    //删除用户
    @Delete("delete from user_info where id=#{id}")
    void delAccount(Account account);

    //添加用户
    @Insert("insert into user_info values(#{id},#{name},#{salary})")
    void addAccount(Account account);
}

4、业务层/持久层整合的配置文件

<?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:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       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/aop
   http://www.springframework.org/schema/aop/spring-aop.xsd
   http://www.springframework.org/schema/tx
   http://www.springframework.org/schema/tx/spring-tx.xsd">

  <!--配置业务层要扫描的包-->
  <context:component-scan base-package="com.yushi">
     <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
  </context:component-scan>

  <!--配置连接池-->
  <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
    <property name="driverClass" value="com.mysql.jdbc.Driver"/>
    <property name="jdbcUrl" value="jdbc:mysql://ip:port/test"/>
    <property name="user" value="****"/>
    <property name="password" value="*****"/>
  </bean>

  <!--配置sqlsessionFactory工厂-->
  <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
  </bean>

  <!--配置dao要扫描的包-->
  <bean id="mapperScanner" class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <property name="basePackage" value="com.yushi.dao"/>
  </bean>

  <!--配置Spring框架声明式事务管理-->
  <!--配置事务管理器-->
  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource" />
  </bean>

  <!--配置事务通知-->
  <tx:advice id="txAdvice" transaction-manager="transactionManager">
    <tx:attributes>
      <tx:method name="find*" read-only="true"/>
      <tx:method name="*" isolation="DEFAULT"/>
    </tx:attributes>
  </tx:advice>

  <!--配置AOP增强-->
  <aop:config>
    <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.yushi.service.impl.*.*(..))"/>
  </aop:config>

</beans>

5、调试下整合后的效果,成功获得持久层的数据(业务层、持久层建立联系没有问题)

public class client {
    @Test
    public void run2(){
        ApplicationContext ioc = new ClassPathXmlApplicationContext("applicationContext.xml");
        IAccountService accountService = (IAccountService)ioc.getBean("accountService");

        List<Account> accounts = accountService.findAccount();
        for (Account account:accounts){
            System.out.println(account);
        }   
    }
}

在这里插入图片描述
6、开始建立表现层与业务层之间的联系,配置webapp包下的index.jsp,确保前端入口可以正确访问到服务端表现层

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>测试</title>
</head>
<body>
    <a href="/user/findAll">查询用户信息</a><br/>

    <form action="/user/delAccount" method="post">
        用户id:<input type="text" name="id"><br/>
               <input type="submit" value="提交"><br/>
    </form>

    <form action="/user/addAccount" method="post">
        用户id <input type="text" name="id"><br/>
        用户名:<input type="text" name="name"><br/>
        工资: <input type="text" name="salary"><br/>
               <input type="submit" value="提交">
    </form>

</body>
</html>

7、配置前端控制器,表现层的枢纽部分,对应web.xml文件

<!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
  <display-name>Archetype Created Web Application</display-name>

  <!--配置spring的监听器-->
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <!--设置配置文件的路径-->
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext.xml</param-value>
  </context-param>

  <!--配置前端控制器-->
  <servlet>
    <servlet-name>dispatcherServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <!--加载springmvc配置文件-->
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:springmvc.xml</param-value>
    </init-param>
    <!--启动服务器,创建servlet-->
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>dispatcherServlet</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>

  <!--解决中文乱码问题-->
  <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>
  </filter>
  <filter-mapping>
    <filter-name>characterEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>


</web-app>

8、配置表现层对应spring容器的初始化文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
       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
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd">
    
    <!--开启注解扫描,只扫描controller注解-->
    <context:component-scan base-package="com.yushi">
        <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>
    
    <!--配置视图解析器-->
    <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/pages/"/>
        <property name="suffix" value=".jsp"/>
    </bean>
    
    <!--开启springmvc注解的支持-->
    <mvc:annotation-driven/>
    
</beans>

9、在controller包下定义AccountController类,定义方法用于跟业务层进行联系

@Controller
@RequestMapping("/user")
public class AccountController {

    @Autowired
    private IAccountService accountService;

    //查询所有账户
    @RequestMapping("/findAll")
    public String findAll(Model model){
        System.out.println("表现层findAll方法执行了");
        List<Account> accounts = accountService.findAccount();
        for (Account account:accounts){
            System.out.println(account);
        }
        model.addAttribute("list",accounts);
        return "success";
    }

    //删除账户
    @RequestMapping("/delAccount")
    public String delAccount(){
        Account account = new Account();
        account.setId(1);
        System.out.println("表现层delAccount方法执行了");
        accountService.delAccount(account);
        return "success";
    }

    //添加账户
    @RequestMapping("/addAccount")
    public String addAccount(Integer id,String name,Integer salary){
        Account account = new Account();
        account.setId(id);
        account.setName(name);
        account.setSalary(salary);
        System.out.println("表现层addAccount方法执行了");
        accountService.addAccount(account);
        return "success";
    }

}

10、在WEB-INF/pages目录下新建success.jsp用于controller方法请求成功后跳转的页面

<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>成功</title>
</head>
<body>
    <h3>跳转成功</h3>
    <c:forEach items="${list}" var="account">
        ${account.name}<br/>
    </c:forEach>
</body>
</html>

11、项目整体引入的依赖包参考

<properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  <maven.compiler.source>1.8</maven.compiler.source>
  <maven.compiler.target>1.8</maven.compiler.target>
  <spring.version>5.0.2.RELEASE</spring.version>
  <slf4j.version>1.6.6</slf4j.version>
  <log4j.version>1.2.12</log4j.version>
  <mysql.version>5.1.6</mysql.version>
  <mybatis.version>3.4.5</mybatis.version>
</properties>

<dependencies>
  <!-- spring -->
  <dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjweaver</artifactId>
    <version>1.6.8</version>
  </dependency>

  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>${spring.version}</version>
  </dependency>

  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>${spring.version}</version>
  </dependency>

  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>${spring.version}</version>
  </dependency>

  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>${spring.version}</version>
  </dependency>

  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-test</artifactId>
    <version>${spring.version}</version>
  </dependency>

  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-tx</artifactId>
    <version>${spring.version}</version>
  </dependency>

  <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>${spring.version}</version>
  </dependency>

  <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.12</version>
    <scope>compile</scope>
  </dependency>

  <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>${mysql.version}</version>
  </dependency>

  <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    <scope>provided</scope>
  </dependency>

  <dependency>
    <groupId>javax.servlet.jsp</groupId>
    <artifactId>jsp-api</artifactId>
    <version>2.0</version>
    <scope>provided</scope>
  </dependency>

  <dependency>
    <groupId>jstl</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
  </dependency>

  <!-- log start -->
  <dependency>
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
    <version>${log4j.version}</version>
  </dependency>

  <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>${slf4j.version}</version>
  </dependency>

  <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>${slf4j.version}</version>
  </dependency>

  <!-- log end -->
  <dependency>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis</artifactId>
    <version>${mybatis.version}</version>
  </dependency>

  <dependency>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis-spring</artifactId>
    <version>1.3.0</version>
  </dependency>

  <dependency>
    <groupId>c3p0</groupId>
    <artifactId>c3p0</artifactId>
    <version>0.9.1.2</version>
    <type>jar</type>
    <scope>compile</scope>
  </dependency>
</dependencies>

三、结合项目层级介绍用户请求代码走向
在这里插入图片描述
1、通过Tomcat启动后端服务时,Tomcat会加载web.xml配置,创建servletContext域对象,同时还会初始化两个bean工厂,一个是springmvc.xml,一个是applicationContext.xml

1、applicationContext是通过监听器,监听servletContext对象是否创建而进行创建的
2、关于spring对应的bean工厂初始化的对象有哪些大家可配置文件即可

2、用户最初通过http://localhost:8080/index.jsp访问到index.jsp资源文件,触发事件
在这里插入图片描述
3、通过index.jsp中的事件触发请求到DispatcherServlet前端控制器,通过前端控制器分发到映射器,也就是我们配置的@requestMapping注解,映射到目标方法执行
在这里插入图片描述
4、执行controller层方法,会注入service层对象执行service下对应的接口方法(这个时候程序处理逻辑已经来到了业务层)
在这里插入图片描述
5、在service接口实现方法中又注入了dao层对象,然后通过方法去调用通知dao层(这个时候程序已经走到持久层)
在这里插入图片描述
6、DAO层对数据进行响应的增删改查,将结果返回到service层,service层又将结果向上返回到controller
在这里插入图片描述
7、最后controller层将最终结果通知到success.jsp文件
8、用户看到最后的变动效果
在这里插入图片描述

四、SSM简单整合demo源码

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

SSM三层架构之间整合 的相关文章

  • 在 JTable 中移动行

    我使用 MVC 模式 并且有一个如下所示的 JTable List
  • 热重载在docker中运行的java程序

    我开发了一个java程序 应该在docker中运行 然而 我在调试docker中运行的java程序时遇到了很多痛苦 我在网上搜索 一些教程提出了像 spring dev tools 这样的工具 因为我的java程序是基于spring boo
  • Android Studio 在编译时未检测到支持库

    由于 Android Studio 将成为 Android 开发的默认 IDE 因此我决定将现有项目迁移到 Android studio 中 项目结构似乎不同 我的项目中的文件夹层次结构如下 Complete Project gt idea
  • 解决错误:日志已在具有多个实例的atomikos中使用

    我仅在使用atomikos的实时服务器上遇到问题 在我的本地服务器上它工作得很好 我在服务器上面临的问题是 init 中出错 日志已在使用中 完整的异常堆栈跟踪 java lang RuntimeException Log already
  • JNI 不满意链接错误

    我想创建一个简单的 JNI 层 我使用Visual studio 2008创建了一个dll Win 32控制台应用程序项目类型 带有DLL作为选项 当我调用本机方法时 出现此异常 Exception occurred during even
  • ExceptionConverter:java.io.IOException:文档没有页面。我正在使用 iText

    当我执行下面的代码时 File f new File c sample pdf PdfWriter getInstance document new FileOutputStream f document open System out p
  • java.io.IOException: %1 不是有效的 Win32 应用程序

    我正在尝试对 XML 文档进行数字签名 为此我有两个选择 有一个由爱沙尼亚认证中心为程序员创建的库 还有一个由银行制作的运行 Java 代码的脚本 如果使用官方 认证中心 库 那么一切都会像魅力一样进行一些调整 但是当涉及到银行脚本时 它会
  • jdbc4.MySQLSyntaxErrorException:数据库中不存在表

    我正在使用 SpringBoot 开发一个网络应用程序 这是我的application properties文件来指定访问数据库的凭据 spring datasource driverClassName com mysql jdbc Dri
  • 迁移到 java 17 后有关“每个进程的内存映射”和 JVM 崩溃的 GC 警告

    我们正在将 java 8 应用程序迁移到 java 17 并将 GC 从G1GC to ZGC 我们的应用程序作为容器运行 这两个基础映像之间的唯一区别是 java 的版本 例如对于 java 17 版本 FROM ubuntu 20 04
  • 反思 Groovy 脚本中声明的函数

    有没有一种方法可以获取 Groovy 脚本中声明的函数的反射数据 该脚本已通过GroovyShell目的 具体来说 我想枚举脚本中的函数并访问附加到它们的注释 Put this到 Groovy 脚本的最后一行 它将作为脚本的返回值 a la
  • 将 Long 转换为 DateTime 从 C# 日期到 Java 日期

    我一直尝试用Java读取二进制文件 而二进制文件是用C 编写的 其中一些数据包含日期时间数据 当 DateTime 数据写入文件 以二进制形式 时 它使用DateTime ToBinary on C 为了读取 DateTime 数据 它将首
  • 应用程序关闭时的倒计时问题

    我制作了一个 CountDownTimer 代码 我希望 CountDownTimer 在完成时重新启动 即使应用程序已关闭 但它仅在应用程序正在运行或重新启动应用程序时重新启动 因此 如果我在倒计时为 00 10 分钟 秒 时关闭应用程序
  • 将 JSON 参数从 java 发布到 sinatra 服务

    我有一个 Android 应用程序发布到我的 sinatra 服务 早些时候 我无法读取 sinatra 服务上的参数 但是 在我将内容类型设置为 x www form urlencoded 之后 我能够看到参数 但不完全是我想要的 我在
  • Keycloak - 自定义 SPI 未出现在列表中

    我为我的 keycloak 服务器制作了一个自定义 SPI 现在我必须在管理控制台上配置它 我将 SPI 添加为模块 并手动安装 因此我将其放在 module package name main 中 并包含 module xml 我还将其放
  • 查看Jasper报告执行的SQL

    运行 Jasper 报表 其中 SQL 嵌入到报表文件 jrxml 中 时 是否可以看到执行的 SQL 理想情况下 我还想查看替换每个 P 占位符的值 Cheers Don JasperReports 使用 Jakarta Commons
  • 将2-3-4树转换为红黑树

    我正在尝试将 2 3 4 树转换为 java 中的红黑树 但我无法弄清楚它 我将这两个基本类编写如下 以使问题简单明了 但不知道从这里到哪里去 public class TwoThreeFour
  • 休眠以持久保存日期

    有没有办法告诉 Hibernate java util Date 应该持久保存 我需要这个来解决 MySQL 中缺少的毫秒分辨率问题 您能想到这种方法有什么缺点吗 您可以自己创建字段long 或者使用自定义的UserType 实施后User
  • 中断连接套接字

    我有一个 GUI 其中包含要连接的服务器列表 如果用户单击服务器 则会连接到该服务器 如果用户单击第二个服务器 它将断开第一个服务器的连接并连接到第二个服务器 每个新连接都在一个新线程中运行 以便程序可以执行其他任务 但是 如果用户在第一个
  • JAVA - 如何从扫描仪读取文件中检测到“\n”字符

    第一次海报 我在读取文本文件的扫描仪中读取返回字符时遇到问题 正在读取的文本文件如下所示 test txt start 2 0 30 30 1 1 90 30 0 test txt end 第一行 2 表示两个点 第二行 位置索引 0 xp
  • java8 Collectors.toMap() 限制?

    我正在尝试使用java8Collectors toMap on a Stream of ZipEntry 这可能不是最好的想法 因为在处理过程中可能会发生异常 但我想这应该是可能的 我现在收到一个我不明白的编译错误 我猜是类型推理引擎 这是

随机推荐

  • Vue 3.0 模板语法

    Vue js 使用了基于 HTML 的模板语法 允许开发者声明式地将 DOM 绑定至底层组件实例的数据 所有 Vue js 的模板都是合法的 HTML 所以能被遵循规范的浏览器和 HTML 解析器解析 在底层的实现上 Vue 将模板编译成虚
  • 一文快速学会hadoop完全分布式集群搭建,很详细

    文章目录 前言 一 准备工作 二 克隆三台虚拟机并进行网络配置 克隆 虚拟机克隆引导 修改网络配置 验证 验证方式一 验证方式二 三 安装jdk和hadoop 四 ssh免密登录配置 概述 生成公钥和私钥 把公钥拷贝到三台虚拟机上面去 验证
  • DeformableConv(可形变卷积)理论和代码分析

    DeformableConv 可形变卷积 理论和代码分析 代码参考 DeformableConv代码 理论参考 bilibili视频讲解 1 DeformableConv理论分析 以上图为例进行讲解 在普通卷积中 input输入尺寸为 ba
  • 判断键盘输入三位数上百位十位个位上的数字

    用python实现 判断键盘输入三位数上百位十位个位上的数字 a list input 请输入三位 for i in range 1 4 if i 1 print 百位是 a 0 elif i 2 print 十位是 a 1 else pr
  • BES2300x笔记(5) -- 配对与回连的各场景详解

    哈喽大家好 这是该系列博文的第五篇 篇 lt lt 系列博文索引 快速通道 gt gt 一 前言 在这篇 TWS组对与蓝牙配对 博文里 我们提到了耳机与手机的组对和配对过程 其实就是蓝牙在不同访问模式间切换的体现 typedef uint8
  • SpringCloud读取Nacos配置中心报错:Could not resolve placeholder ‘xxx’ in value ‘${xxx}

    hello 我是灰小猿 一个超会写bug的程序员 近期在写一个spring cloud Alibaba读取Nacos配置中心远程配置文件的内容时 出现了几个比较坑的bug 在此记录一下 帮大家避避坑 我的使用场景 SpringBoot版本为
  • python 获取本地视频信息_Python利用B站API获取视频信息

    本帖最后由 skeep 于 2017 7 23 12 28 编辑 Python利用B站API获取视频信息 这两天工作中需要写两个简单的爬虫 我自己参考网上的资料 手动实现了一下 今天总结一下发给大家 参考链接 https www v2ex
  • 【Logstash】管理【软件包安装日志dpkg】【图形服务器日志Xorg】

    1 dpkg日志管理 1 配置文件dpkg conf 2 启动elasticsearch与kibana 启动见 Logstash ElasticSearch Kibana 安装测试 日志存储 3 在logstash安装目录运行配置文件 bi
  • 浏览器访问ipv6地址的ip与端口

    示例 http ipv6地址 端口 例如 http xxx xxx xxx 8000
  • 网络空间安全概论 第二章 作业

    课程 学校 学校云 下载APP 搜索感兴趣的课程 个人中心 网络空间安全概论 申请认证证书 郭文忠 董晨 张浩 何萧玲 杨旸 邹剑 刘延华 李应 倪一涛 孙及园 评价课程 公告 评分标准 课件 测验与作业 考试 讨论区 课程分享 微信提醒课
  • od机考真题-数格子,跳格子游戏

    while 1 try n int input lst for in range n lst append list map
  • 拥抱vite + vue3,制作一款属于自己的音乐播放器。

    VUE3 MUSIC 拥抱vite vue3 制作一款属于自己的音乐播放器 一 项目介绍 基于 VITE VUE3 TS PINIA TAILWINDCSS 开发的音乐播放器 界面模仿网易云音乐客户端 参考 SmallRuralDog vu
  • git使用问题

    1 windows 7专业版使用sourceTree拉取代码的问题 之前一直用的好好的 今天拉不了代码了 错误如下 git c diff mnemonicprefix false c core quotepath false fetch o
  • jsp+servlet实现的简单登录验证

    jsp servlet连接数据库的登录验证 1 打开IDEA 新建login jsp文件
  • springboot图片验证码

    前言 大家好 我是小小 今天我们用五分钟来用springboot实现我们常用的图形验证码功能模块 用户登录几乎是一个线上系统必不可少且使用相对比较频繁的一个模块 为了防止恶意暴力尝试 防止洪水攻击 防止脚本自动提交等 验证码是一个较为便捷且
  • 二十、待机唤醒实验

    目录 一 stm32的三种低功耗模式 二 寄存器的介绍 1 电源控制寄存器 PWR CR 2 电源控制 状态寄存器 PWR CSR 三 库函数配置的具体步骤 1 使能电源时钟 2 设置 WK UP 引脚作为唤醒源 3 设置 SLEEPDEE
  • C++错误解决:double free or corruption (out): 0x00000000011abe70 ***

    前言 博主最近疯狂的迷恋上了leetcode刷题 想要锻炼脑力和算法思想的 推荐去这个网站上刷题 因为是用c 编写的 而且提交的时候会经常遇到一些报错 比如题目的这个 好了 下面开始解答 错误信息 double free or corrup
  • 总结:printf打印时需要的格式字符(占位符)

    在C语言中 printf有许多不同的打印格式 这些格式都是我们需要去了解的 下面我将简单讲解一下需要打印不同的类型时 后面需要加的字母 打印int类型十进制整数 d 打要short类型的整数 h 也可以加l和ll组成 lh和 llh 打印l
  • “阿里爸爸”最新产出:Java面试突击核心讲(1658页),转载40W+

    现在的互联网开发岗招聘 程序员面试背八股文已经成为了不可逆转的形式 其中一个Java岗几百人在投简历也已经成为了常态 更何况一份面试题动辄七八百道 你吃透了 技术只要不是很差 面试怎么可能有大问题 但是也有尴尬的情况发生 面试八股文背的特别
  • SSM三层架构之间整合

    一 前言 之前学习ssm框架的时候都是每个框架独立分散的系统性学习 对于框架的整体 总结效果不太好 后来看了黑马视频教程有个老师的思路给了我比较大的启发 以spring为中心 去整合springmvc mybatis 无论是搭建环境 还是理