标签:thymeleaf click onclick 表名 spl efi gif str bad
一、准备数据
+----+--------+-------+
| id | name | power |
+----+--------+-------+
| 1 | 关羽 | 99.2 |
| 2 | 吕布 | 99.9 |
| 3 | 张飞 | 98.5 |
+----+--------+-------+
说明:mysql本地数据库,数据库名为"study",表名"hero"。
二、创建spring boot项目
三、配置
src/main/resources/application.properties
1 # 视图引擎thymeleaf的配置 2 # 开启缓存,在开发阶段可关闭,部署后可开启 3 spring.thymeleaf.cache=true 4 spring.thymeleaf.encoding=utf-8 5 spring.thymeleaf.mode=HTML 6 spring.thymeleaf.prefix=classpath:/templates/ 7 spring.thymeleaf.suffix=.html 8 9 # mysql数据库的配置(版本8.0) 10 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 11 spring.datasource.url=jdbc:mysql://localhost:3306/news?serverTimezone=UTC 12 spring.datasource.username=root 13 spring.datasource.password=root
四、开发
1、实体类
Hero.class
1 package com.zyz.demo4.domain; 2 3 /** 4 * Hero类跟表hero一一对应 5 */ 6 public class Hero { 7 private Integer id; 8 9 public Integer getId() { 10 return id; 11 } 12 13 public void setId(Integer id) { 14 this.id = id; 15 } 16 17 public String getName() { 18 return name; 19 } 20 21 public void setName(String name) { 22 this.name = name; 23 } 24 25 public Float getPower() { 26 return power; 27 } 28 29 public void setPower(Float power) { 30 this.power = power; 31 } 32 33 private String name; 34 private Float power; 35 }
2、
标签:thymeleaf click onclick 表名 spl efi gif str bad
原文地址:https://www.cnblogs.com/beast-king/p/13166208.html