首页 > 其他分享 >SSM整合加简单的增删改查

SSM整合加简单的增删改查

时间:2023-12-04 17:56:14浏览次数:30  
标签:Book int 改查 SSM book org 增删 import public

SSM整合加简单的增删改查

  • 创建项目

image-20231204172511314

image-20231204172551451

  • 添加web项目文件夹

    image-20231204172634087

    image-20231204172647657

  • 在pom.xml 添加依赖

        <dependencies>
            <!--    junit 测试-->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13</version>
                <scope>test</scope>
            </dependency>
            <!--    mysql-->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>8.0.26</version>
            </dependency>
    <!--        c3p0 连接池-->
            <dependency>
                <groupId>com.mchange</groupId>
                <artifactId>c3p0</artifactId>
                <version>0.9.5.2</version>
            </dependency>
    
            <!--    lombok -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>1.18.24</version>
            </dependency>
            <!--    servlet -->
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>2.5</version>
                <scope>provided</scope>
            </dependency>
            <!--    servlet-jsp -->
    
            <dependency>
                <groupId>javax.servlet.jsp</groupId>
                <artifactId>jsp-api</artifactId>
                <version>2.2</version>
                <scope>provided</scope>
            </dependency>
            <!-- jstl -->
            <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.10</version>
            </dependency>
    
            <!--    mybatis-spring -->
            <dependency>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis-spring</artifactId>
                <version>2.1.0</version>
            </dependency>
            <!--    springmvc-->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>5.3.21</version>
            </dependency>
            <!--    spring jdbc :事务-->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>5.3.21</version>
            </dependency>
            <!--    aop-->
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjweaver</artifactId>
                <version>1.9.5</version>
            </dependency>
    
    
        </dependencies>
    
        <!--    导入依赖 配置 -->
        <build>
            <resources>
                <resource>
                    <directory>src/main/java</directory>
                    <includes>
                        <include>**/*.yml</include>
                        <include>**/*.xml</include>
                        <include>**/*.properties</include>
                    </includes>
                    <filtering>true</filtering>
                </resource>
                <resource>
                    <directory>src/main/resources</directory>
                    <includes>
                        <include>**/*.yml</include>
                        <include>**/*.xml</include>
                        <include>**/*.properties</include>
                    </includes>
                    <filtering>true</filtering>
                </resource>
            </resources>
        </build>
    
    
  • 配置文件

    image-20231204172951637

    • database.properties: mysql信息配置文件

      jdbc.driver=com.mysql.cj.jdbc.Driver
      jdbc.url=jdbc:mysql://localhost:3306/text?userUnicode=true&characterEncoding=utf8
      jdb.username=root
      jdb.password=123456
      
    • applictionContext.xml : spring配置文件

      <?xml version="1.0" encoding="UTF8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:tx="http://www.springframework.org/schema/tx"
             xmlns:context="http://www.springframework.org/schema/context"
             xmlns:aop="http://www.springframework.org/schema/aop"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.springframework.org/schema/beans
             https://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/context
             https://www.springframework.org/schema/context/spring-context.xsd
             http://www.springframework.org/schema/tx
             https://www.springframework.org/schema/tx/spring-tx.xsd
             http://www.springframework.org/schema/aop
             https://www.springframework.org/schema/aop/spring-aop.xsd
      ">
          <!--    关联数据文件-->
          <context:property-placeholder location="classpath:database.properties"></context:property-placeholder>
          <!--    配置数据库连接池-->
          <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
              <!--        关联数据库连接池属性 -->
              <property name="driverClass" value="${jdbc.driver}"></property>
              <property name="jdbcUrl" value="${jdbc.url}"></property>
              <property name="user" value="${jdb.username}"></property>
              <property name="password" value="${jdb.password}"></property>
              <!--        c3p0 配置-->
              <!--        最大连接池 和 最小连接池 -->
              <property name="maxPoolSize" value="30"></property>
              <property name="minPoolSize" value="10"></property>
          </bean>
          <!--    配置sqlSessionFactory-->
          <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
              <!--        注入数据库连接池 -->
              <property name="dataSource" ref="dataSource"></property>
           <!--        配置mybatis文件-->
              <property name="configLocation" value="classpath:mybatis-config.xml"></property>
              <!--        指定mybatis映射文件-->
              <property name="mapperLocations" value="classpath*:map/*.xml"></property>
          </bean>
          <!--    扫描mapper-->
          <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
              <!--        注入sqlSessionFactory-->
              <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
              <property name="basePackage" value="com.L.mapper"></property>
          </bean>
          <!--    扫描service 使注解生效-->
          <context:component-scan base-package="com.L.service"></context:component-scan>
          <!--    事务 -->
          <bean id="txManage" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
              <property name="dataSource" ref="dataSource"></property>
          </bean>
          <!--    配置事务的通知-->
          <tx:advice id="txAdvice" transaction-manager="txManage">
              <tx:attributes>
                  <tx:method name="*" propagation="REQUIRED"/>
              </tx:attributes>
          </tx:advice>
          <!--配置aop事务-->
          <aop:config>
              <aop:pointcut id="txPointcut" expression="execution(* com.L.service.*.*(..))"/>
              <aop:advisor advice-ref="txAdvice" pointcut-ref="txPointcut"></aop:advisor>
          </aop:config>
      </beans>
      
    • springmvc.xml:springmvc配置文件

      <?xml version="1.0" encoding="UTF8"?>
      <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
             https://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/mvc
              https://www.springframework.org/schema/mvc/spring-mvc.xsd
                 http://www.springframework.org/schema/context
              https://www.springframework.org/schema/context/spring-context.xsd
      
      ">
      
          <!--    开启 注解支持-->
          <mvc:annotation-driven></mvc:annotation-driven>
      
          <!--    静态资源-->
          <mvc:default-servlet-handler></mvc:default-servlet-handler>
          <!--    扫描controller-->
          <context:component-scan base-package="com.L.controller"></context:component-scan>
      
          <mvc:resources location="/static/" mapping="/static/**" />
          <!--    视图解析器-->
          <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
              <property name="prefix" value="/WEB-INF/jsp/"></property>
              <property name="suffix" value=".jsp"></property>
          </bean>
      
      
      </beans>
      
      
    • mybatis-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>
      
      </configuration>
      
    • beans.xml: 总的配置文件

      <?xml version="1.0" encoding="UTF8"?>
      <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
             https://www.springframework.org/schema/beans/spring-beans.xsd
      ">
      <import resource="applicationContext.xml"></import>
      <import resource="springmvc.xml"></import>
      </beans>
      
  • 配置web.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">
        <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:beans.xml</param-value>
            </init-param>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
            <servlet-name>springmvc</servlet-name>
            <url-pattern>/</url-pattern>
        </servlet-mapping>
        <!--    乱码过滤器-->
        <filter>
            <filter-name>encodingFilter</filter-name>
            <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
            <init-param>
                <param-name>encoding</param-name>
                <param-value>utf8</param-value>
            </init-param>
        </filter>
        <filter-mapping>
            <filter-name>encodingFilter</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
    </web-app>
    
  • jsp文件:页面

    image-20231204173939897

    • index.jsp

      <%--
        User: LIJIAN
        Date: 2023/12/4
        Time: 11:32
        To change this template use File | Settings | File Templates.
      --%>
      <%@ page contentType="text/html;charset=UTF-8" language="java" %>
      <html>
      <head>
          <title>$Title$</title>
      </head>
      <body>
      <h3>
          <a href="${pageContext.request.contextPath}/book/allBook">点击</a>
      </h3>
      </body>
      </html>
      
      
    • allBook.jsp

      <%--
        User: LIJIAN
        Date: 2023/12/4
        Time: 12:21
        To change this template use File | Settings | File Templates.
      --%>
      <%@ page contentType="text/html;charset=UTF-8" language="java" %>
      <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
      <html>
      <head>
          <title>书籍列表 --- 显示所有书籍</title>
      </head>
      <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap/css/bootstrap.min.css"/>
      <body>
      <div class="container">
          <div class="row clearfix">
              <div class="row clearfix">
                  <div class="col-md-12 column">
                      <div class="page-item">
                          <h1>
                              <small>书籍列表----显示所有书籍</small>
                          </h1>
      
                      </div>
                  </div>
      
                  <div>
                      <div>
                          <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/toAddBook">增加书籍</a>
                      </div>
                  </div>
      
              </div>
          </div>
      
          <div class="row clearfix">
              <div class="col-md-12 column">
                  <table class="table table-hover table-striped">
                      <thead>
                      <tr>
                          <th>编号</th>
                          <th>书籍姓名</th>
                          <th>数量</th>
                          <th>详情</th>
                          <th>操作</th>
                      </tr>
                      </thead>
                      <taody>
                          <c:forEach var="book" items="${list}">
                              <tr>
                                  <td>${book.bookID}</td>
                                  <td>${book.bookName}</td>
                                  <td>${book.bookCount}</td>
                                  <td>${book.detail}</td>
                                  <td>
                                      <a class="btn btn-danger"
                                         href="${pageContext.request.contextPath}/book/toUpdateBook/${book.bookID}">修改</a>
                                      <a class="btn btn-danger"
                                         href="${pageContext.request.contextPath}/book/deleteBook/${book.bookID}">删除</a>
                                  </td>
                              </tr>
      
                          </c:forEach>
                      </taody>
                  </table>
              </div>
          </div>
      
      </div>
      
      </body>
      </html>
      
      
      
    • addBook.jsp

      <%--
        User: LIJIAN
        Date: 2023/12/4
        Time: 12:50
        To change this template use File | Settings | File Templates.
      --%>
      <%@ page contentType="text/html;charset=UTF-8" language="java" %>
      <html>
      <head>
          <title>添加书籍</title>
      </head>
      <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap/css/bootstrap.min.css"/>
      <body>
      
      <div class="container">
      
          <div class="row clearfix">
              <div class="col-md-12 column">
                  <div class="page-item">
                      <h1>
                          <small>
                              新增书籍
                          </small>
                      </h1>
                  </div>
              </div>
      
              <form action="${pageContext.request.contextPath}/book/addBook" method="post">
                  <div class="form-group">
      
                      <label>书籍名称:</label>
                      <input type="text" name="bookName" class="form-control" required>
                  </div>
                  <div class="form-group">
      
                      <label>书籍数量:</label>
                      <input type="text" name="bookCount" class="form-control" required>
                  </div>
                  <div class="form-group">
      
                      <label>书籍描述:</label>
                      <input type="text" name="detail" class="form-control" required>
                  </div>
                  <div class="form-group">
                      <input type="submit" class="form-control" value="添加">
                  </div>
              </form>
      
          </div>
      </div>
      </body>
      </html>
      
      
    • updateBook.jsp

      <%--
        User: LIJIAN
        Date: 2023/12/4
        Time: 12:58
        To change this template use File | Settings | File Templates.
      --%>
      <%@ page contentType="text/html;charset=UTF-8" language="java" %>
      <html>
      <head>
          <title>更新书籍</title>
      </head>
      <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap/css/bootstrap.min.css"/>
      <body>
      
      <div class="container">
      
          <div class="row clearfix">
              <div class="col-md-12 column">
                  <div class="page-item">
                      <h1>
                          <small>
                              修改书籍
                          </small>
                      </h1>
                  </div>
              </div>
      
              <form action="${pageContext.request.contextPath}/book/updateBook" method="post">
                  <input type="hidden" name="bookID" class="form-control" value="${book.bookID}">
                  <div class="form-group">
      
                      <label>书籍名称:</label>
                      <input type="text" name="bookName" class="form-control" required value="${book.bookName}">
                  </div>
                  <div class="form-group">
      
                      <label>书籍数量:</label>
                      <input type="text" name="bookCount" class="form-control" required value="${book.bookCount}">
                  </div>
                  <div class="form-group">
      
                      <label>书籍描述:</label>
                      <input type="text" name="detail" class="form-control" required value="${book.detail}">
                  </div>
                  <div class="form-group">
                      <input type="submit" class="form-control" value="修改">
                  </div>
      
      
              </form>
      
          </div>
      </div>
      
      </body>
      </html>
      
      
  • 代码部分

    image-20231204174253501

    • entity:实体类

      package com.L.entity;
      
      import lombok.AllArgsConstructor;
      import lombok.Data;
      import lombok.NoArgsConstructor;
      
      /**
       * @Author LIJIAN
       * @Date 2023/12/4 13:01
       */
      
      //全参构造
          @AllArgsConstructor
      //    无参构造
          @NoArgsConstructor
      //    set get
          @Data
      public class Book {
      private int bookID;
      private String bookName;
      private int bookCount;
      private String detail;
      
      }
      
      
    • mapper

      • BookMapper

        package com.L.mapper;
        
        import com.L.entity.Book;
        import org.springframework.stereotype.Repository;
        
        import java.util.List;
        
        /**
         * @Author LIJIAN
         * @Date 2023/12/4 13:08
         */
        @Repository
        public interface BookMapper {
            List<Book> listBook();
            int addBook(Book book);
            int delete(int id);
            Book upBookID(int id);
            int upBook(Book book);
        }
        
        
    • resources/map

      • BookMapper.xml

        <?xml version="1.0" encoding="UTF8" ?>
        <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
        
        
        <mapper namespace="com.L.mapper.BookMapper">
        
        
            <delete id="delete">
                delete
                from ssm_test
                where bookID = #{id};
            </delete>
        
            <select id="listBook" resultType="com.L.entity.Book">
                select *
                from ssm_test
            </select>
        
        
            <insert id="addBook">
                insert into ssm_test(bookName, bookCount, detail)
                    value (#{bookName},#{bookCount},#{detail})
            </insert>
        
        
            <select id="upBookID" resultType="com.L.entity.Book">
        
                select *
                from ssm_test
                where bookID = #{id}
            </select>
        
            <update id="upBook">
                update ssm_test
                set bookName=#{bookName},
                    bookCount=#{bookCount},
                    detail=#{detail}
                where bookID = #{bookID}
        
        
            </update>
        </mapper>
        
    • service

      • BookService
      package com.L.service;
      
      import com.L.entity.Book;
      
      import java.util.List;
      
      /**
       * @Author LIJIAN
       * @Date 2023/12/4 13:11
       */
      
      public interface BookService {
      
          List<Book> list();
          int addBook(Book book);
          int delete(int id);
          Book upBookID(int id);
          int upBook(Book book);
      }
      
      
      • BookServiceImpl

        package com.L.service.impl;
        
        import com.L.entity.Book;
        import com.L.mapper.BookMapper;
        import com.L.service.BookService;
        import org.springframework.beans.factory.annotation.Autowired;
        import org.springframework.stereotype.Service;
        
        import java.util.List;
        
        /**
         * @Author LIJIAN
         * @Date 2023/12/4 13:12
         */
        @Service
        public class BookServiceImpl implements BookService {
        
            @Autowired
            private BookMapper bookMapper;
        
            @Override
            public List<Book> list() {
                List<Book> list = bookMapper.listBook();
                return list;
            }
        
            @Override
            public int addBook(Book book) {
               int i = bookMapper.addBook(book);
                return i;
            }
        
            @Override
            public int delete(int id) {
              int i=  bookMapper.delete(id);
                return i;
            }
        
            @Override
            public Book upBookID(int id) {
        
                return   bookMapper.upBookID(id);
            }
        
            @Override
            public int upBook(Book book) {
        
                return bookMapper.upBook(book);
            }
        }
        
        
    • controller

      • BookController

        package com.L.controller;
        
        import com.L.entity.Book;
        import com.L.service.BookService;
        import org.springframework.beans.factory.annotation.Autowired;
        import org.springframework.stereotype.Controller;
        import org.springframework.ui.Model;
        import org.springframework.web.bind.annotation.PathVariable;
        import org.springframework.web.bind.annotation.RequestMapping;
        
        import java.util.List;
        
        /**
         * @Author LIJIAN
         * @Date 2023/12/4 13:15
         */
        @Controller
        @RequestMapping("/book")
        public class BookController {
        
            @Autowired
            private BookService bookService;
        
            @RequestMapping("/allBook")
            public String list(Model model) {
                List<Book> list = bookService.list();
                model.addAttribute("list", list);
                return "allBook";
            }
        
            @RequestMapping("/toAddBook")
            public String preAdd() {
                return "addBook";
            }
        
            @RequestMapping("/addBook")
            public String addBook(Book book) {
                int i = bookService.addBook(book);
                return "redirect:/book/allBook";
            }
        
        
            @RequestMapping("/deleteBook/{bookID}")
            public String deleteBook(@PathVariable int bookID) {
                int i = bookService.delete(bookID);
                return "redirect:/book/allBook";
            }
        
            @RequestMapping("/toUpdateBook/{bookID}")
            public String UpdateBookID(@PathVariable int bookID, Model model) {
                Book book = bookService.upBookID(bookID);
                model.addAttribute("book", book);
                return "updateBook";
            }
        
            @RequestMapping("/updateBook")
            public String UpdateBook(Book book) {
                int i = bookService.upBook(book);
                return "redirect:/book/allBook";
            }
        
        
        }
        
        
  • 数据库设计

    image-20231204174816874
    -效果


标签:Book,int,改查,SSM,book,org,增删,import,public
From: https://www.cnblogs.com/1999LIJIAN/p/17875564.html

相关文章

  • 数据“表”的增删改查
    创建数据库删除数据库修改数据库 查看数据库喜欢点赞收藏,如有疑问,点击链接加入群聊【信创技术交流群】:http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=EjDhISXNgJlMMemn85viUFgIqzkDY3OC&authKey=2SKLwlmvTpbqlaQtJ%2FtFXJgHVgltewcfvbIpzdA7BMjIjt2YM1h71qlJoIuWxp7K&noverify=0&gro......
  • [VBA] 实现SQLserver数据库的增删改查
    [VBA]实现SQLserver数据库的增删改查问题背景用于库存管理的简单Excel系统实现,能够让库管员录入每日出入库信息并进能够按日期查询导出数据,生成简要报表,以及数据修改与删除。非科班且对VB语言和数据库语言未系统学习,有一点C语言与Python基础,有不足之处还请指教。实现过程数......
  • SSM SpringBoot vue考勤信息管理系统
    SSMSpringBootvue考勤信息管理系统系统功能登录注册个人中心部门信息管理上班时间管理考勤信息管理员工信息管理签到管理请假信息管理加班申请管理出差申请管理开发环境和技术开发语言:Java使用框架:SSM(Spring+SpringMVC+Mybaits)或SpringBoot前端:v......
  • 数据库表的创建、数据类型、约束条件、增删改数据
    MYSQL数据库、表基本操作一、常用数据类型1.1、整型类型数据类型所占字节存储范围(有符号)存储范围(无符号)TINYINT1字节-128~1270~255SMALLINT2字节-32768~327670~65535MEDIUMINT3字节-8388608~83886070~16777215INT4字节-2147483648~21474836470~4294967......
  • json-server的增删改查与基本使用
    1.查看是否安装node2.查看是否安装npm3.安装json-server4.查看json-server的版本5.json-server--watchdb.json6.配置db.json文件下载 apifoxjson-server的增删改查在apifox中创建一个快捷调试直接点击发送,当body中返回下面内容,表示添加成功注意:不需要添加id,他会自......
  • C/C++ 通过SQLiteSDK增删改查
    SQLite,作为一款嵌入式关系型数据库管理系统,一直以其轻量级、零配置以及跨平台等特性而备受青睐。不同于传统的数据库系统,SQLite是一个库,直接与应用程序一同编译和链接,无需单独的数据库服务器进程,实现了数据库的零配置管理。这种设计理念使得SQLite成为许多嵌入式系统、移动应用和......
  • 简单了解SSM框架的作用,面试浅谈
    SSM和SSH是比较流行的Web框架,今天主要说下SSM(其实是我不了解SSH,哈哈);话不多说进入正题,SSM主要构成Spring,SpringMVC,Mybatis三大部分组成,分别说一下他们的作用;首先关于框架的概念:框架:在这里特指软件框架,它是我们在实际开发中解决项目需求的技术集合。运用框架可以大大简化我们的代码......
  • SQLAlchemy快速使用、SQLAlchemy原生操作、SQLAlchemy操作表、一对多关系、多对多关系
    SQLAlchemy快速使用介绍#SQLAlchemy是一个基于Python实现的ORM框架,对象关系映射#orm框架----》djangoorm--》只能用在django中,不能独立使用#python界的orm框架-peewee:小型-sqlalchemy:企业级,支持异步,用在异步框架中-djagnoormm-TortoiseORM......
  • 【Django使用】django经验md文档10大模块。第4期:Django数据库增删改查
    Django的主要目的是简便、快速的开发数据库驱动的网站。它强调代码复用,多个组件可以很方便的以"插件"形式服务于整个框架,Django有许多功能强大的第三方插件,你甚至可以很方便的开发出自己的工具包。这使得Django具有很强的可扩展性。它还强调快速开发和DRY(DoNotRepeatYourself)原......
  • Qt中使用QNetworkAccessManager类发送https请求时状态码返回0
    前言在项目开发中,碰到一个问题,使用QNetworkAccessManager类对象发送https请求时,状态码一直返回0,抓包分析看请求响应也是正常的。费了好大劲终于搞定了,主要是两个原因导致的。原因一:未设置支持SSL/TLS协议默认是不支持https协议的,需要在代码中手动设置下QNetworkRequestreqDown......