当前位置:网站首页>Configuration SSM Hell?Un modèle de consolidation est rapidement résolu![Collection recommandée]

Configuration SSM Hell?Un modèle de consolidation est rapidement résolu![Collection recommandée]

2021-10-14 05:05:35 LongDi - IDEA

Spring+SpringMVC+Mybatis

Configuration de l'environnement
IDEA
MySQL 5.7
Tomcat 8.5
Maven 3.6
Créer une base de données

CREATE DATABASE `ssmbuild`;

USE `ssmbuild`;

DROP TABLE IF EXISTS `books`;

CREATE TABLE `books` (
`bookID` INT(10) NOT NULL AUTO_INCREMENT COMMENT 'Les livresid',
`bookName` VARCHAR(100) NOT NULL COMMENT 'Titre du livre',
`bookCounts` INT(11) NOT NULL COMMENT 'Nombre',
`detail` VARCHAR(200) NOT NULL COMMENT 'Description',
KEY `bookID` (`bookID`)
) ENGINE=INNODB DEFAULT CHARSET=utf8

INSERT  INTO `books`(`bookID`,`bookName`,`bookCounts`,`detail`)VALUES
(1,'Java',1,'De commencer à abandonner'),
(2,'MySQL',10,'De l'effacement de la bibliothèque à la course'),
(3,'Linux',5,'De la porte d'entrée à la prison');

Insérer la description de l'image ici

Écrire la classe d'entité pour la base de donnéescom.longdi.pojo.Books
ImporterlombokInpom.xmlMoyenne

package com.longdi.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/** * @author:  Frère long.  * @description * @date: 2021/9/27 20:22 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Books {
    
    private int bookID;
    private String bookName;
    private int bookCounts;
    private String detail;
}

Importer despomDépendance

<dependencies>
        <!--Junit-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
        <!--Pilote de base de données-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.47</version>
        </dependency>
        <!-- Pool de connexion à la base de données -->
        <dependency>
            <groupId>com.mchange</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.5.2</version>
        </dependency>

        <!--Servlet - JSP -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <!--Mybatis-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.2</version>
        </dependency>
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>2.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <version>1.8.4</version>
        </dependency>
        <!--Spring-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>5.1.9.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>5.1.9.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.16</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

Paramètres de filtrage des ressources

<build>
   <resources>
       <resource>
           <directory>src/main/java</directory>
           <includes>
               <include>**/*.properties</include>
               <include>**/*.xml</include>
           </includes>
           <filtering>false</filtering>
       </resource>
       <resource>
           <directory>src/main/resources</directory>
           <includes>
               <include>**/*.properties</include>
               <include>**/*.xml</include>
           </includes>
           <filtering>false</filtering>
       </resource>
   </resources>
</build>

MybatisÉcriture de niveau
Créationmybatis-config.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>

    <settings>
        <setting name="logImpl" value="STDOUT_LOGGING"/>
    </settings>

    <typeAliases>
        <package name="com.longdi.pojo"/>
    </typeAliases>
    <mappers>
        <mapper class="com.longdi.dao.BookMapper"/>
    </mappers>
</configuration>
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssmbuild?useSSL=true&useUnicode=true&characterEncoding=utf8
jdbc.username=root
jdbc.password=123456

CompilationDaoStratifiéMapperInterface

package com.longdi.dao;

import com.longdi.pojo.Books;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/** * @author:  Frère long.  * @description * @date: 2021/9/27 20:32 */
public interface BookMapper {
    
    // Ajouter un livre 
    int addBook(Books books);

    // Supprimer un livre 
    int deleteBookById(@Param("bookId") int id);

    // Mise à jour d'un livre 
    int updateBook(Books books);

    // Consultez un livre 
    Books queryBookById(@Param("bookId")int id);

    // Consultez tous les livres 
    List<Books> queryAllBook();

    Books queryBookByName(@Param("bookName")String bookName);

}

Écrire l'interface correspondante Mapper.xml Documentation.Importation requiseMyBatisLe sac de;

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.longdi.dao.BookMapper">
    <insert id="addBook" parameterType="Books">
       insert into ssmbuild.books(bookName,bookCounts,detail)
       values(#{bookName},#{bookCounts},#{detail});
    </insert>

    <delete id="deleteBookById" parameterType="int">
        delete from ssmbuild.books where bookID=#{bookId}
    </delete>
    
    <update id="updateBook" parameterType="Books">
        update ssmbuild.books
        set bookName=#{bookName},bookCounts=#{bookCounts},detail=#{detail}
        where bookID=#{bookID};

    </update>

    <select id="queryBookById" resultType="Books">
        select * from ssmbuild.books
        where bookID=#{bookId}
    </select>

    <select id="queryAllBook" resultType="Books">
        select * from ssmbuild.books
    </select>
    
    <select id="queryBookByName" resultType="Books">
        select * from ssmbuild.books where bookName=#{bookName}
    </select>
    
</mapper>

CompilationServiceInterface de la couche

package com.longdi.service;

import com.longdi.pojo.Books;


import java.util.List;

/** * @author:  Frère long.  * @description * @date: 2021/9/27 21:03 */
public interface BookService {
    
    // Ajouter un livre 
    int addBook(Books books);

    // Supprimer un livre 
    int deleteBookById( int id);

    // Mise à jour d'un livre 
    int updateBook(Books books);

    // Consultez un livre 
    Books queryBookById(int id);

    // Consultez tous les livres 
    List<Books> queryAllBook();

    Books queryBookByName(String bookName);
}

ServiceClasse d'implémentation de la couche

package com.longdi.service;

import com.longdi.dao.BookMapper;
import com.longdi.pojo.Books;
import org.springframework.stereotype.Service;

import java.util.List;

/** * @author:  Frère long.  * @description * @date: 2021/9/27 21:05 */

public class BookServiceImpl implements BookService{
    

    private BookMapper bookMapper;
    public void setBookMapper(BookMapper bookMapper) {
    
        this.bookMapper = bookMapper;
    }

    public int addBook(Books books) {
    
        return bookMapper.addBook(books);
    }

    public int deleteBookById(int id) {
    
        return bookMapper.deleteBookById(id);
    }

    public int updateBook(Books books) {
    
        System.out.println("BookServiceImpl:updateBook=>"+books);
        return bookMapper.updateBook(books);
    }

    public Books queryBookById(int id) {
    
        return bookMapper.queryBookById(id);
    }

    public List<Books> queryAllBook() {
    
        return bookMapper.queryAllBook();
    }

    public Books queryBookByName(String bookName) {
    
        return bookMapper.queryBookByName(bookName);
    }
}

SpringIntégrationMybatis spring-dao.xml
Ce qui suit:springCouche

<?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" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">

    <!-- Configurer la consolidationmybatis -->
    <!-- 1.Associer des fichiers de base de données -->
    <context:property-placeholder location="classpath:database.properties"/>

    <!-- 2.Pool de connexion à la base de données -->
    <!--Pool de connexion à la base de données dbcp Fonctionnement semi - automatique Impossible de se connecter automatiquement c3p0 Opérations automatisées(Chargement automatique des profils Et le mettre dans l'objet) -->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <!-- Configurer les propriétés du pool de connexion -->
        <property name="driverClass" value="${jdbc.driver}"/>
        <property name="jdbcUrl" value="${jdbc.url}"/>
        <property name="user" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>

        <!-- c3p0Propriétés privées du pool de connexion -->
        <property name="maxPoolSize" value="30"/>
        <property name="minPoolSize" value="10"/>
        <!-- Pas automatiquement après la fermeture de la connexioncommit -->
        <property name="autoCommitOnClose" value="false"/>
        <!-- Obtenir le délai de connexion -->
        <property name="checkoutTimeout" value="10000"/>
        <!-- Quand obtenir le nombre de tentatives de connexion échouées -->
        <property name="acquireRetryAttempts" value="2"/>
    </bean>

    <!-- 3.ConfigurationSqlSessionFactoryObjet -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!-- Injecter le pool de connexion à la base de données -->
        <property name="dataSource" ref="dataSource"/>
        <!-- ConfigurationMyBatiesProfil global:mybatis-config.xml -->
        <property name="configLocation" value="classpath:mybatis-config.xml"/>
    </bean>

    <!-- 4.Configurer le scanDaoPaquet d'interface,Mise en œuvre dynamiqueDaoInterface injectée dansspringDans le récipient -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!-- InjectionsqlSessionFactory -->
        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
        <!-- Donne le scan requisDaoPaquet d'interface -->
        <property name="basePackage" value="com.longdi.dao"/>
    </bean>

</beans>

spring-service.xmlDocumentation

<?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">

    <!-- ScanserviceQuestions connexesbean -->
    <context:component-scan base-package="com.longdi.service" />

    <!--BookServiceImplInjecté dansIOCDans le récipient-->
    <bean id="BookServiceImpl" class="com.longdi.service.BookServiceImpl">
        <property name="bookMapper" ref="bookMapper"/>
    </bean>

    <!-- Configurer le gestionnaire de transactions -->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <!-- Injecter le pool de connexion à la base de données -->
        <property name="dataSource" ref="dataSource" />
    </bean>
    <!--aop Les choses soutiennent -->

    <!--Unionaop Réaliser le tissage des choses -->
    <!-- Configurer les notifications pour les choses -->

    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="*" propagation="REQUIRED"/>
        </tx:attributes>
    </tx:advice>

    <!-- Configurer la Coupe des choses -->
    <aop:config>
        <aop:pointcut id="txPointCut" expression="execution(* com.longdi.dao.*.*(..))"/>
        <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointCut"/>
    </aop:config>

</beans>

Ce qui suit:SpringMVCCouche
Configurationweb.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">

    <!--DispatcherServlet-->
    <servlet>
        <servlet-name>DispatcherServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <!--Attention!: Nous chargeons ici le profil général , C'était un trou ici avant !-->
            <param-value>classpath:applicationContext.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>DispatcherServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <!--encodingFilter-->
    <filter>
        <filter-name>encodingFilter</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>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!--SessionDate d'expiration-->
    <session-config>
        <session-timeout>15</session-timeout>
    </session-config>

</web-app>

spring-mvc.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" 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">

    <!-- ConfigurationSpringMVC -->
    <!-- 1.OuvertSpringMVCAnnotation Drive -->
    <mvc:annotation-driven />
    <!-- 2.Ressources statiques par défautservletConfiguration-->
    <mvc:default-servlet-handler/>

    <!-- 3.Configurationjsp AfficherViewResolverVoir l'analyseur -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
        <property name="prefix" value="/WEB-INF/jsp/" />
        <property name="suffix" value=".jsp" />
    </bean>

    <!-- 4.ScanwebQuestions connexesbean -->
    <context:component-scan base-package="com.longdi.controller" />

</beans>

SpringConfigurer le fichier de consolidation,CréationapplicationContext.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">

    <import resource="spring-dao.xml"/>
    <import resource="spring-service.xml"/>
    <import resource="spring-mvc.xml"/>

</beans>

Ci - dessusSSMConfiguration de l'environnement pour, Écrivez ci - dessous Controller Couches et vues , Réaliser le livre CRUDFonction

controllerCouche Fonctions d'ajout, de suppression et de recherche de livres

import java.util.ArrayList;
import java.util.List;

/** * @author:  Frère long.  * @description * @date: 2021/9/27 22:47 */
@Controller
@RequestMapping("/book")
public class BookController {
    

    @Autowired
    @Qualifier("BookServiceImpl")
    private BookService bookService;

    @RequestMapping("/allBook")
    public String list(Model model) {
    
        List<Books> list = bookService.queryAllBook();
        model.addAttribute("list", list);
        return "allBook";
    }
    //Aller à la page ajouter un livre
    @RequestMapping("/toAddBook")
    public String toAddPaper(){
    
        return "addBook";
    }
    //Demande d'ajout d'un livre
    @RequestMapping("/addBook")
    public String addBook(Books books){
    
        System.out.println("addBook=>"+books);
        bookService.addBook(books);
        return "redirect:/book/allBook";
    }
    // Aller à la page modifier 
    @RequestMapping("toUpdateBook")
    public String toUpdatePaper(int id,Model model){
    
        Books books = bookService.queryBookById(id);
        model.addAttribute("book",books);
        return "updateBook";
    }
    //Modifier les livres
    @RequestMapping("updateBook")
    public String updateBook(Books books){
    
        System.out.println("updateBook=>"+books);
        int i=bookService.updateBook(books);
        if(i>0){
    
            System.out.println("AjouterbooksSuccès"+books);
        }

        return "redirect:/book/allBook";
    }

    //Supprimer les livres
    @RequestMapping("/deleteBook/{bookId}")
    public String deleBook(@PathVariable("bookId") int id){
    
        bookService.deleteBookById(id);
        return "redirect:/book/allBook";
    }
    //Recherche de livres
    @RequestMapping("/queryBook")
    public String queryBook(String queryBookName,Model model){
    
         Books books=bookService.queryBookByName(queryBookName);
        System.err.println("queryBook=>"+books);
         List<Books> list=new ArrayList<Books>();
         list.add(books);

         if(books==null){
    
             list=bookService.queryAllBook();
             model.addAttribute("error","Non trouvé");
         }

         model.addAttribute("list",list);
         return "allBook";
    }

}

Écrivez la page d'accueilindex.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE HTML>
<html>
<head>
  <title>Page d'accueil</title>
  <style> a{
       text-decoration: none; color:black; font-size:18px; } h3{
       width:180px; height:38px; margin: 100px auto; text-align: center; line-height: 38px; background: deepskyblue; border-radius: 4px; } </style>
</head>

<h3>
  <a href="${pageContext.request.contextPath}/book/allBook"> Aller à la page du livre </a>
</h3>
</body>
</html>

Écrivez une page de liste de livres allBook.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>Liste des livres</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <!-- Introduction Bootstrap -->
  <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>

<div class="container">

  <div class="row clearfix">
    <div class="col-md-12 column">
      <div class="page-header">
        <h1>
          <small>Liste des livres —— Afficher tous les livres</small>
        </h1>
      </div>
    </div>
  </div>

  <div class="row">
    <div class="col-md-4 column">
      <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/toAddBook">Nouveaux livres</a>
      <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/allBook">Afficher tous les livres</a>
    </div>
    <div class="col-md-4 column">
      <div class="col-md-8 column"></div>
      <%--Recherche de livres--%>

      <form class="form-inline" action="${pageContext.request.contextPath}/book/queryBook" method="post" style="float: right">
        <span style="color:red;font-weight: bold">${error}</span>
          <input type="text" name="queryBookName" class="form-control" placeholder="Veuillez saisir le nom du livre à interroger">
          <input type="submit" value="Requête" class="btn btn-primary"/>
      </form>
    </div>
  </div>

  <div class="row clearfix">
    <div class="col-md-12 column">
      <table class="table table-hover table-striped">
        <thead>
        <tr>
          <th>Numéro du livre</th>
          <th>Nom du livre</th>
          <th>Nombre de livres</th>
          <th>Détails du livre</th>
          <th>Fonctionnement</th>
        </tr>
        </thead>

        <tbody>
        <c:forEach var="book" items="${requestScope.get('list')}">
          <tr>
            <td>${book.getBookID()}</td>
            <td>${book.getBookName()}</td>
            <td>${book.getBookCounts()}</td>
            <td>${book.getDetail()}</td>
            <td>

              <a href="${pageContext.request.contextPath}/book/toUpdateBook?id=${book.getBookID()}">Changement</a> |
              <a href="${pageContext.request.contextPath}/book/deleteBook/${book.getBookID()}">Supprimer</a>
            </td>
          </tr>
        </c:forEach>
        </tbody>
      </table>
    </div>
  </div>
</div>

Ajouter une page de livre addBook.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>Nouveaux livres</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Introduction Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">

    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>Nouveaux livres</small>
                </h1>
            </div>
        </div>
    </div>
    <form action="${pageContext.request.contextPath}/book/addBook" method="post">
        Nom du livre:<input type="text" name="bookName"><br><br><br>
        Nombre de livres:<input type="text" name="bookCounts"><br><br><br>
        Détails du livre:<input type="text" name="detail"><br><br><br>
        <input type="submit" value="Ajouter">
    </form>

</div>

Modifier la page du livre updateBook.jsp

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Modifier les informations</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Introduction Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">

    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>Modifier les informations</small>
                </h1>
            </div>
        </div>
    </div>

    <form action="${pageContext.request.contextPath}/book/updateBook" method="post">
        <input type="hidden" name="bookID" value="${book.getBookID()}"/>
        Nom du livre:<input type="text" name="bookName" value="${book.getBookName()}"/>
        Nombre de livres:<input type="text" name="bookCounts" value="${book.getBookCounts()}"/>
        Détails du livre:<input type="text" name="detail" value="${book.getDetail() }"/>
        <input type="submit" value="Soumettre"/>
    </form>

</div>

 Aller à la page du livre

Insérer la description de l'image ici

Insérer la description de l'image ici

Projet déployé àtomcatMoyenne
Insérer la description de l'image ici

Structure du projet
Insérer la description de l'image ici
Insérer la description de l'image ici
gitee Site web télécharger le code source
github Site web télécharger le code source

版权声明
本文为[LongDi - IDEA]所创,转载请带上原文链接,感谢
https://chowdera.com/2021/10/20211013211842807z.html

随机推荐