会话跟踪技术 - Cookie 和 Session 快速上手 + 登陆注册案例( 八 )

  • Brand.java
    package priv.dandelion.entity;public class User {    private Integer id;    private String username;    private String password;    public User(Integer id, String username, String password) {        this.id = id;        this.username = username;        this.password = password;    }    public User() {    }    public Integer getId() {        return id;    }    public void setId(Integer id) {        this.id = id;    }    public String getUsername() {        return username;    }    public void setUsername(String username) {        this.username = username;    }    public String getPassword() {        return password;    }    public void setPassword(String password) {        this.password = password;    }    @Override    public String toString() {        return "User{" +                "id=" + id +                ", username='" + username + '\'' +                ", password='" + password + '\'' +                '}';    }}
  • Mybatis核心配置文件
    <?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="priv.dandelion.entity"/>    </typeAliases>    <environments default="development">        <environment id="development">            <!-- 采用JDBC的事务管理方式 -->            <transactionManager type="JDBC"/>            <!-- 数据库连接信息 -->            <dataSource type="POOLED">                <property name="driver" value=https://www.huyubaike.com/biancheng/"com.mysql.jdbc.Driver"/>

    经验总结扩展阅读