maven将layui依赖引入HTML中,Springboot+mybaties+pagehelper+thymeleaf+layui+maven搭建项目

一、创建maven项目,项目结构如图

关于项目的创建这里就不在多做介绍,如有不懂的,可以留言

a3cf3744f932f0303650bb4a68ea88f3.png

二、在pom文件中引入所需要的jar

如下是我pom文件引入的jar及详细说明:

mysql

mysql-connector-java

8.0.11

com.alibaba

druid

1.1.12

org.mybatis.spring.boot

mybatis-spring-boot-starter

2.0.0

tk.mybatis

mapper-spring-boot-starter

2.1.5

tk.mybatis

mapper

4.0.3

com.github.pagehelper

pagehelper-spring-boot-starter

1.2.3

org.mybatis.generator

mybatis-generator-core

1.3.7

compile

true

log4j

log4j

1.2.17

org.springframework.boot

spring-boot-devtools

true

org.springframework.boot

spring-boot-starter-thymeleaf

三、配制application.yml文件

server:

port: 8080

#  servlet:

#    context-path: /store #项目名配

# 配制模板引擎

spring:

thymeleaf:

prefix: classpath:/templates/views/

suffix: .html

mode: HTML5

encoding: UTF-8

servlet:

content-type: text/html

cache: false # 关闭缓存,即时刷新,上线生产环境前改为true

mvc:

static-path-pattern: /static/**

# mysql 属性配置

datasource:

#     driver-class-name: com.mysql.jdbc.Driver #1.8前的版本使用

driver-class-name: com.mysql.cj.jdbc.Driver

#     url: jdbc:mysql://localhost:3306/mh_db_02?useSSL=flase&verifyServerCertificate=false; #本地

url: jdbc:mysql://你的mysql地址:3306/数据名?useSSL=false&useUnicode=true; #服务器

username: 用户名

password: 密码

#为mybatis设置,生产环境可删除

restart:

include:

mapper: /mapper-[\\w-\\.]+jar

pagehelper: /pagehelper-[\\w-\\.]+jar

companycommonlibs: tk/mybatis.*

#    companycommonlibs: com.share.store.*

# mybatis 集成相关配置

mybatis:

type-aliases-package: com.share.store.**.domain

mapper-locations: classpath:mapper/**/*Mapper.xml

# mappers 多个接口时逗号隔开(通用mapper配制)

mapper:

mappers:

- com.share.store.utils.MyMapper

not-empty: false

identity: MYSQL

# pagehelper 分页插件配制

pagehelper:

helperDialect: mysql

reasonable: true

supportMethodsArguments: true

params: count=countSql

# log 日志配制

logging:

level:

com.share.store: debug #配制控制台打印sql

注:根据配制文件来配制所需要的文件及创建文件夹

四、Springboot启动类配制

77e59067e0d82fbebc87c016bc8750e5.png

五、完结

启动运行,输入地址访问,大功告成

最后,如果有需要源码的朋友,在评论区留言。

标签:mybaties,mapper,Springboot,spring,layui,boot,mysql,mybatis,com

来源: https://blog.csdn.net/qq_28245087/article/details/87891326

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值