基于Spring MVC + Spring + MyBatis的【图书信息管理系统(一)】

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
云数据库 RDS PostgreSQL,集群系列 2核4GB
简介: 基于Spring MVC + Spring + MyBatis的【图书信息管理系统(一)】

一、语言和环境


1.实现语言:JAVA语言。

2.环境要求:MyEclipse/Eclipse + Tomcat + MySql。

3.使用技术:SpringMVC + Spring + Mybatis。


二、实现功能


随着校内图书馆的发展,现需要制作图书信息管理系统,主要功能如下:

1.首页默认显示所有图书信息


34.png


2.鼠标悬停某行数据时,以线性过渡动画显示光棒效果


35.png


.用户输入图书名称,点击查询,则完成模糊查询,显示查询结果


36.png


用户点击删除,则弹出提示框,用户点击确定后,删除选中数据并显示最新数据


37.png


5.用户点击“新增”按钮,则打开新增页面,填写完相关信息后点击新增按钮,增加图书信息数据到数据库,且页面跳转到列表页面展示最新数据



38.png

39.png


三、数据库设计


1.创建数据库(book_db)。

2.创建数据表(book),结构如下。


39.png


四、推荐实现步骤


1.SSM版本的实现步骤如下:

(1)创建数据库和数据表,添加测试数据(至少添加4条测试数据)。

(2)创建Web工程并创建各个包,导入工程所需的jar文件。

(3)添加相关SSM框架支持。

(4)配置项目所需要的各种配置文件(mybatis配置文件、spring配置文件、springMVC配置文件)。

(5)创建实体类。

(6)创建MyBatis操作数据库所需的Mapper接口及其Xml映射数据库操作语句文件。

(7)创建业务逻辑相应的接口及其实现类,实现相应的业务,并在类中加入对DAO/Mapper的引用和注入。

(8)创建Controller控制器类,在Controller中添加对业务逻辑类的引用和注入,并配置springMVC配置文件。

(9)创建相关的操作页面,并使用CSS对页面进行美化。

(10)实现页面的各项操作功能,并在相关地方进行验证,操作要人性化。

(11)调试运行成功后导出相关的数据库文件并提交。


五、实现代码


1、MySQL数据库


book_db


40.png

/*
 Date: 25/07/2021 22:09:28
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for book
-- ----------------------------
DROP TABLE IF EXISTS `book`;
CREATE TABLE `book`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `price` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  `create_date` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of book
-- ----------------------------
INSERT INTO `book` VALUES (1, '龙珠', '漫画', '56.00', '2021-07-14 14:07:42');
INSERT INTO `book` VALUES (2, '火影忍者', '漫画', '48.00', '2021-07-24 14:08:25');
INSERT INTO `book` VALUES (3, '三体', '科幻小说', '128.00', '2021-07-22 14:09:08');
INSERT INTO `book` VALUES (4, '西游记', '文学', '98.00', '2021-07-20 14:09:55');
INSERT INTO `book` VALUES (5, '进击的巨人', '动漫', '68.00', '2021-07-06 14:10:22');
SET FOREIGN_KEY_CHECKS = 1;


2、项目Java代码


目录结构

Books


41.png


JAR包:


42.png


43.png


src

com.controller【控制层】

BookController.java


package com.controller;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.entity.Book;
import com.service.BookService;
@Controller
public class BookController {
  @Resource
  BookService bookService;
  @RequestMapping("/booksList")
  public String getBooks(Model model, String name) {
    List<Book> bookList = bookService.selectAll(name);
    model.addAttribute("bookList", bookList);
    return "/book";
  }
  @RequestMapping("/deleteBook")
  public String deleteBook(int id) {
    int delBook = bookService.delBook(id);
    return "redirect:/booksList.do";
  }
  // 跳转添加页面的方法
  @RequestMapping("/insertInto")
  public String insertInto() {
    return "addBook";
  }
  // 跳转添加页面的方法
  @RequestMapping("/insertBook")
  public String insertBook(Book book) {
    int addBook = bookService.insertBook(book);
    return "redirect:/booksList.do";
  }
}


com.dao【数据库访问层】

BookMapper.java


package com.dao;
import com.entity.Book;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface BookMapper {
    int deleteByPrimaryKey(Integer id);
    int insert(Book record);
    List<Book> selectAll(@Param("name")String name);
}


BookMapper.xml
<?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.dao.BookMapper">
  <resultMap id="BaseResultMap" type="com.entity.Book">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="price" jdbcType="VARCHAR" property="price" />
    <result column="create_date" jdbcType="VARCHAR" property="createDate" />
  </resultMap>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from book
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.entity.Book">
    insert into book (id, name, type,
    price, create_date)
    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
    #{type,jdbcType=VARCHAR},
    #{price,jdbcType=VARCHAR}, #{createDate,jdbcType=VARCHAR})
  </insert>
  <select id="selectAll" resultMap="BaseResultMap">
    select id, name, type, price, create_date
    from book
    <where>
      <if test="name!= null">name like "%"#{name}"%"   </if>
    </where>
  </select>
</mapper>


com.entity【实体的包】

Book.java


package com.entity;
public class Book {
    private Integer id;
    private String name;
    private String type;
    private String price;
    private String createDate;
    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 == null ? null : name.trim();
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }
    public String getPrice() {
        return price;
    }
    public void setPrice(String price) {
        this.price = price == null ? null : price.trim();
    }
    public String getCreateDate() {
        return createDate;
    }
    public void setCreateDate(String createDate) {
        this.createDate = createDate == null ? null : createDate.trim();
    }
}


com.service【义务处理层接口】

BookService.java


package com.service;
import java.util.List;
import com.entity.Book;
public interface BookService {
  //查询
  List<Book> selectAll(String name);
  //删除
  int delBook(int id);
  //添加
  int insertBook(Book book);
}


com.serviceImpl【实现层】

BookServiceImpl.java


package com.serviceImpl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.dao.BookMapper;
import com.entity.Book;
import com.service.BookService;
@Service
public class BookServiceImpl implements BookService {
  @Resource 
  BookMapper mapper;
  @Override
  public List<Book> selectAll(String name) {
    List<Book> selectAll=mapper.selectAll(name);
    return selectAll;
  }
  @Override
  public int delBook(int id) {
    int deleteBook=mapper.deleteByPrimaryKey(id);
    return deleteBook;
  }
  @Override
  public int insertBook(Book book) {
    int insert=mapper.insert(book);
    return insert;
  }
}


mybatis

sqlMapConfig.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
  <!-- 别名 -->
  <typeAliases>
    <package name="com.entity" />
  </typeAliases>
</configuration>


spring

applicationContext-dao.xml


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns="http://www.springframework.org/schema/beans" 
  xmlns:p="http://www.springframework.org/schema/p" 
  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-4.2.xsd 
  http://www.springframework.org/schema/context 
  http://www.springframework.org/schema/context/spring-context-4.2.xsd 
  http://www.springframework.org/schema/aop 
  http://www.springframework.org/schema/aop/spring-aop-4.2.xsd 
  http://www.springframework.org/schema/tx
  http://www.springframework.org/schema/tx/spring-tx.xsd
  http://www.springframework.org/schema/mvc 
    http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd ">
  <!-- 指定spring容器读取db.properties文件 -->
  <context:property-placeholder location="classpath:jdbc.properties"></context:property-placeholder>
  <!-- 将连接池注册到bean容器中 -->
  <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
    <property name="driverClassName" value="${jdbc.driver}"></property>
    <property name="Url" value="${jdbc.url}"></property>
    <property name="username" value="${jdbc.username}"></property>
    <property name="password" value="${jdbc.password}"></property>
  </bean>
  <!-- 配置SqlSessionFactory -->
  <bean class="org.mybatis.spring.SqlSessionFactoryBean">
    <!-- 设置MyBatis核心配置文件 -->
    <property name="configLocation" value="classpath:mybatis/sqlMapConfig.xml" />
    <!-- 设置数据源 -->
    <property name="dataSource" ref="dataSource" />
  </bean>
  <!-- 配置Mapper扫描 -->
  <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
    <!-- 设置Mapper扫描包 -->
    <property name="basePackage"  value="com.dao" />
  </bean>
  <!-- 配置事务管理器 -->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      <property name="dataSource" ref="dataSource"></property>
    </bean>
    <!-- 开启注解方式管理AOP事务 -->
    <tx:annotation-driven transaction-manager="transactionManager" />
</beans>

applicationContext-service.xml


<?xml version="1.0" encoding="UTF-8"?>
<beans  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://www.springframework.org/schema/beans" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:aop="http://www.springframework.org/schema/aop" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xmlns:mvc="http://www.springframework.org/schema/mvc" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-4.2.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-4.2.xsd 
    http://www.springframework.org/schema/aop 
    http://www.springframework.org/schema/aop/spring-aop-4.2.xsd 
    http://www.springframework.org/schema/tx 
    http://www.springframework.org/schema/tx/spring-tx-4.2.xsd 
    http://www.springframework.org/schema/mvc 
    http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd ">
    <!-- 配置Service扫描 -->
    <context:component-scan base-package="com" />
</beans>


spring-mvc.xml


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
  xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:mvc="http://www.springframework.org/schema/mvc"
  xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-4.2.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-4.2.xsd 
    http://www.springframework.org/schema/aop 
    http://www.springframework.org/schema/aop/spring-aop-4.2.xsd 
    http://www.springframework.org/schema/tx 
    http://www.springframework.org/schema/tx/spring-tx-4.2.xsd 
    http://www.springframework.org/schema/mvc 
    http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd ">
  <!-- 配置Controller扫描 -->
  <context:component-scan base-package="com.controller" />
  <!-- 配置注解驱动 -->
  <mvc:annotation-driven />
  <!-- 配置视图解析器 -->
  <bean
    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <!-- 前缀 -->
    <property name="prefix" value="/WEB-INF/jsp/" />
    <!-- 后缀 -->
    <property name="suffix" value=".jsp" />
  </bean>
</beans>


jdbc.properties


jdbc.url=jdbc:mysql://localhost:3306/book_db?useUnicode=true&characterEncoding=UTF-8&useSSL=false
jdbc.username=root
jdbc.password=123456
jdbc.driver=com.mysql.jdbc.Driver


WebContent

web.xml


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>Books</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <!--spring容器  -->
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:spring/applicationContext-*.xml</param-value>
  </context-param>
  <!-- 监听器,加载spring配置 -->
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <!-- 前端控制器 -->
  <servlet>
    <servlet-name>springmvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:spring/spring-mvc.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>springmvc</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <!-- 设置post请求的字符编码过滤器 -->
  <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>


jsp

index.jsp


<%@ page language="java" contentType="text/html; charset=utf-8"
  pageEncoding="utf-8"%>
<!DOCTYPE html>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort(
      + path;
%>
<html>
<head>
<meta charset="utf-8">
<title>登录</title>
</head>
<body>
  <script type="text/javascript">
  window.location.href="<%=basePath%>/booksList.do";
  </script>
</body>
</html>


addBook.jsp


<%@ page language="java" contentType="text/html; charset=utf-8"
  pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head>
<meta charset="utf-8">
<title>录入信息</title>
<style type="text/css">
table {
  margin: auto;
}
.button {
  margin: auto;
}
</style>
</head>
<body>
  <form action="insertBook.do">
    <table border="0" cellspacing="" cellpadding="">
      <tr>
        <td>&nbsp;&nbsp;&nbsp;
          <h1 style="text-align:;">新增图书信息</h1>
        </td>
      </tr>
      <tr>
        <td><input type="hidden" name="id" value="${book.id}">
          图书名称:&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="name"
          value="${book.name}"></td>
      </tr>
      <tr>
        <td>图书类别:&nbsp;&nbsp;&nbsp;&nbsp; <input type="text"
          name="type" value="${book.type}">
        </td>
      </tr>
      <tr>
        <td>图书价格:&nbsp;&nbsp;&nbsp;&nbsp; <input type="text"
          name="price" value="${book.price}">
        </td>
      </tr>
      <tr>
        <td>出版时间:&nbsp;&nbsp;&nbsp;&nbsp; <input type="text"
          name="createDate" value="${book.createDate}">
        </td>
      </tr>
      <tr>
        <td>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input
          style="width: 100px;" type="submit" value="新增" />
        </td>
      </tr>
    </table>
  </form>
</body>
</html>


book.jsp


<%@ page language="java" contentType="text/html; charset=utf-8"
  pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<head>
<meta charset="utf-8">
<title>图书信息管理系统</title>
<style type="text/css">
h2 {
  position: relative;
  left: 40%;
}
table {
  text-align: center;
}
.foot {
  margin-right: 100px;
  float: right;
}
tr:hover {
  background: #DEB887;
}
a {
  text-decoration: none;
}
</style>
</head>
<body>
  <h2>图书信息管理系统</h2>
  <fieldset>
    <legend>搜索</legend>
    <form action="booksList.do" method="post">
      图书名称 <input type="text" name="name"> <input type="submit"
        value="搜索" /> <a href="insertInto.do"> <input type="button"
        value="添加" />
      </a>
    </form>
  </fieldset>
  <table width="100%" border="1px" cellpadding="5" cellspacing="3">
    <tr>
      <th width="80px">编号</th>
      <th width="150px">图书名称</th>
      <th width="150px">图书类别</th>
      <th width="150px">图书价格</th>
      <th width="150px">出版时间</th>
      <th width="150px">操作</th>
    </tr>
    <c:forEach var="book" items="${bookList }" varStatus="item">
      <tr>
        <td width="80px">${book.id}</td>
        <td width="150px">${book.name}</td>
        <td width="150px">${book.type}</td>
        <td width="150px">${book.price}</td>
        <td width="150px">${book.createDate}</td>
        <td width="150px">
          <%-- <a href="deleteBook.do?id=${book.id}">删除</a> --%> <a
          href="javascript:if(confirm('确实要删除吗?'))location='deleteBook.do?id=${book.id}'">删除</a>
        </td>
      </tr>
    </c:forEach>
  </table>
  <p>共${bookList.size()}条数据</p>
</body>
</html>



相关实践学习
如何快速连接云数据库RDS MySQL
本场景介绍如何通过阿里云数据管理服务DMS快速连接云数据库RDS MySQL,然后进行数据表的CRUD操作。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
20天前
|
SQL Java 数据库连接
对Spring、SpringMVC、MyBatis框架的介绍与解释
Spring 框架提供了全面的基础设施支持,Spring MVC 专注于 Web 层的开发,而 MyBatis 则是一个高效的持久层框架。这三个框架结合使用,可以显著提升 Java 企业级应用的开发效率和质量。通过理解它们的核心特性和使用方法,开发者可以更好地构建和维护复杂的应用程序。
113 29
|
2月前
|
设计模式 前端开发 Java
步步深入SpringMvc DispatcherServlet源码掌握springmvc全流程原理
通过对 `DispatcherServlet`源码的深入剖析,我们了解了SpringMVC请求处理的全流程。`DispatcherServlet`作为前端控制器,负责请求的接收和分发,处理器映射和适配负责将请求分派到具体的处理器方法,视图解析器负责生成和渲染视图。理解这些核心组件及其交互原理,有助于开发者更好地使用和扩展SpringMVC框架。
69 4
|
3月前
|
前端开发 Java 开发者
Spring MVC中的请求映射:@RequestMapping注解深度解析
在Spring MVC框架中,`@RequestMapping`注解是实现请求映射的关键,它将HTTP请求映射到相应的处理器方法上。本文将深入探讨`@RequestMapping`注解的工作原理、使用方法以及最佳实践,为开发者提供一份详尽的技术干货。
237 2
|
4月前
|
JSON 前端开发 Java
SSM:SpringMVC
本文介绍了SpringMVC的依赖配置、请求参数处理、注解开发、JSON处理、拦截器、文件上传下载以及相关注意事项。首先,需要在`pom.xml`中添加必要的依赖,包括Servlet、JSTL、Spring Web MVC等。接着,在`web.xml`中配置DispatcherServlet,并设置Spring MVC的相关配置,如组件扫描、默认Servlet处理器等。然后,通过`@RequestMapping`等注解处理请求参数,使用`@ResponseBody`返回JSON数据。此外,还介绍了如何创建和配置拦截器、文件上传下载的功能,并强调了JSP文件的放置位置,避免404错误。
|
5月前
|
缓存 前端开发 Java
【Java面试题汇总】Spring,SpringBoot,SpringMVC,Mybatis,JavaWeb篇(2023版)
Soring Boot的起步依赖、启动流程、自动装配、常用的注解、Spring MVC的执行流程、对MVC的理解、RestFull风格、为什么service层要写接口、MyBatis的缓存机制、$和#有什么区别、resultType和resultMap区别、cookie和session的区别是什么?session的工作原理
|
4月前
|
前端开发 Java 应用服务中间件
【Spring】Spring MVC的项目准备和连接建立
【Spring】Spring MVC的项目准备和连接建立
80 2
|
4月前
|
XML 前端开发 Java
Spring,SpringBoot和SpringMVC的关系以及区别 —— 超准确,可当面试题!!!也可供零基础学习
本文阐述了Spring、Spring Boot和Spring MVC的关系与区别,指出Spring是一个轻量级、一站式、模块化的应用程序开发框架,Spring MVC是Spring的一个子框架,专注于Web应用和网络接口开发,而Spring Boot则是对Spring的封装,用于简化Spring应用的开发。
325 0
Spring,SpringBoot和SpringMVC的关系以及区别 —— 超准确,可当面试题!!!也可供零基础学习
|
5月前
|
XML 缓存 前端开发
springMVC02,restful风格,请求转发和重定向
文章介绍了RESTful风格的基本概念和特点,并展示了如何使用SpringMVC实现RESTful风格的请求处理。同时,文章还讨论了SpringMVC中的请求转发和重定向的实现方式,并通过具体代码示例进行了说明。
springMVC02,restful风格,请求转发和重定向
|
6月前
|
Java 数据库连接 Spring
后端框架入门超详细 三部曲 Spring 、SpringMVC、Mybatis、SSM框架整合案例 【爆肝整理五万字】
文章是关于Spring、SpringMVC、Mybatis三个后端框架的超详细入门教程,包括基础知识讲解、代码案例及SSM框架整合的实战应用,旨在帮助读者全面理解并掌握这些框架的使用。
后端框架入门超详细 三部曲 Spring 、SpringMVC、Mybatis、SSM框架整合案例 【爆肝整理五万字】
|
6月前
|
前端开发 应用服务中间件 数据库
SpringMVC入门到实战------八、RESTful案例。SpringMVC+thymeleaf+BootStrap+RestFul实现员工信息的增删改查
这篇文章通过一个具体的项目案例,详细讲解了如何使用SpringMVC、Thymeleaf、Bootstrap以及RESTful风格接口来实现员工信息的增删改查功能。文章提供了项目结构、配置文件、控制器、数据访问对象、实体类和前端页面的完整源码,并展示了实现效果的截图。项目的目的是锻炼使用RESTful风格的接口开发,虽然数据是假数据并未连接数据库,但提供了一个很好的实践机会。文章最后强调了这一章节主要是为了练习RESTful,其他方面暂不考虑。
SpringMVC入门到实战------八、RESTful案例。SpringMVC+thymeleaf+BootStrap+RestFul实现员工信息的增删改查