最新Springboot整合Thymeleaf、layui实现简单的增删改查

Springboot整合Thymeleaf、layui实现简单的增删改查

主页面列表分页显示

最新Springboot整合Thymeleaf、layui实现简单的增删改查_第1张图片

搜索功能

最新Springboot整合Thymeleaf、layui实现简单的增删改查_第2张图片

添加用户

最新Springboot整合Thymeleaf、layui实现简单的增删改查_第3张图片

编辑用户

最新Springboot整合Thymeleaf、layui实现简单的增删改查_第4张图片

Mapper映射

最新Springboot整合Thymeleaf、layui实现简单的增删改查_第5张图片

Controller层

最新Springboot整合Thymeleaf、layui实现简单的增删改查_第6张图片

list.html初始化加载表格数据

最新Springboot整合Thymeleaf、layui实现简单的增删改查_第7张图片

搜索重载表格数据

最新Springboot整合Thymeleaf、layui实现简单的增删改查_第8张图片

application.properties文件

#\u5173\u95ED\u7F13\u5B58, \u5373\u65F6\u5237\u65B0
#spring.freemarker.cache=false
#spring.thymeleaf.cache=true
#打印SQL
logging.level.com.swkj.mapper=debug
#\u70ED\u90E8\u7F72\u751F\u6548
spring.devtools.restart.enabled=true
#\u8BBE\u7F6E\u91CD\u542F\u7684\u76EE\u5F55,\u6DFB\u52A0\u90A3\u4E2A\u76EE\u5F55\u7684\u6587\u4EF6\u9700\u8981restart
spring.devtools.restart.additional-paths=src/main/java
# \u4E3Amybatis\u8BBE\u7F6E\uFF0C\u751F\u4EA7\u73AF\u5883\u53EF\u5220\u9664
restart.include.mapper=/mapper-[\\w-\\.]+jar
restart.include.pagehelper=/pagehelper-[\\w-\\.]+jar
#\u6392\u9664\u90A3\u4E2A\u76EE\u5F55\u7684\u6587\u4EF6\u4E0D\u9700\u8981restart
#spring.devtools.restart.exclude=static/**,public/**
#classpath\u76EE\u5F55\u4E0B\u7684WEB-INF\u6587\u4EF6\u5939\u5185\u5BB9\u4FEE\u6539\u4E0D\u91CD\u542F
#spring.devtools.restart.exclude=WEB-INF/**    
############################################################
#
# \u914D\u7F6E\u6570\u636E\u6E90\u76F8\u5173	\u4F7F\u7528\u963F\u91CC\u5DF4\u5DF4\u7684 druid \u6570\u636E\u6E90
#
############################################################
spring.datasource.url=jdbc:mysql://localhost:3306/springboot?characterEncoding=utf8&useSSL=true
spring.datasource.username=root
spring.datasource.password=1234
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.druid.initial-size=1
spring.datasource.druid.min-idle=1
spring.datasource.druid.max-active=20
spring.datasource.druid.test-on-borrow=true
spring.datasource.druid.stat-view-servlet.allow=true

############################################################
#
# mybatis \u914D\u7F6E
#
############################################################
# mybatis \u914D\u7F6E
mybatis.type-aliases-package=com.swkj.pojo
mybatis.mapper-locations=classpath:mapper/*.xml
#开启驼峰命名转换
mybatis.configuration.map-underscore-to-camel-case=true
# 通用 Mapper 配置
mapper.mappers=com.swkj.utils.MyMapper
mapper.not-empty=false
mapper.identity=MYSQL

############################################################
#
# 配置i18n 资源文件,供thymeleaf 读取
#
############################################################
spring.messages.basename=i18n/messages
spring.messages.cache-seconds=3600
spring.messages.encoding=UTF-8

#设定静态文件路径,js,css等。要使用Swagger,这行需要注释
spring.mvc.static-path-pattern=/static/**

############################################################
#
# thymeleaf 静态资源配置
#
############################################################
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
# 关闭缓存, 即时刷新, 上线生产环境需要改为true
spring.thymeleaf.cache=false

############################################################
#
# Server \u670D\u52A1\u7AEF\u76F8\u5173\u914D\u7F6E
#
############################################################
# \u914D\u7F6Eapi\u7AEF\u53E3\u53F7
server.port=8080
# \u914D\u7F6Econtext-path, \u4E00\u822C\u6765\u8BF4\u8FD9\u4E2A\u914D\u7F6E\u5728\u6B63\u5F0F\u53D1\u5E03\u7684\u65F6\u5019\u4E0D\u914D\u7F6E
#server.context-path=/IMooc
# \u9519\u8BEF\u9875\uFF0C\u6307\u5B9A\u53D1\u751F\u9519\u8BEF\u65F6\uFF0C\u8DF3\u8F6C\u7684URL --> BasicErrorController
#server.error.path=/error
# session\u6700\u5927\u8D85\u65F6\u65F6\u95F4(\u5206\u949F)\uFF0C\u9ED8\u8BA4\u4E3A30\u5206\u949F
server.session-timeout=60
# \u8BE5\u670D\u52A1\u7ED1\u5B9AIP\u5730\u5740\uFF0C\u542F\u52A8\u670D\u52A1\u5668\u65F6\u5982\u672C\u673A\u4E0D\u662F\u8BE5IP\u5730\u5740\u5219\u629B\u51FA\u5F02\u5E38\u542F\u52A8\u5931\u8D25, 
# \u53EA\u6709\u7279\u6B8A\u9700\u6C42\u7684\u60C5\u51B5\u4E0B\u624D\u914D\u7F6E, \u5177\u4F53\u6839\u636E\u5404\u81EA\u7684\u4E1A\u52A1\u6765\u8BBE\u7F6E
#server.address=192.168.1.2

############################################################
# Server - tomcat \u76F8\u5173\u5E38\u7528\u914D\u7F6E
############################################################
# tomcat\u6700\u5927\u7EBF\u7A0B\u6570, \u9ED8\u8BA4\u4E3A200
#server.tomcat.max-threads=250
# tomcat\u7684URI\u7F16\u7801
server.tomcat.uri-encoding=UTF-8
# \u5B58\u653ETomcat\u7684\u65E5\u5FD7\u3001Dump\u7B49\u6587\u4EF6\u7684\u4E34\u65F6\u6587\u4EF6\u5939\uFF0C\u9ED8\u8BA4\u4E3A\u7CFB\u7EDF\u7684tmp\u6587\u4EF6\u5939
#\uFF08\u5982\uFF1AC:\Users\Shanhy\AppData\Local\Temp\uFF09
#server.tomcat.basedir=H:/springboot-tomcat-tmp
# \u6253\u5F00Tomcat\u7684Access\u65E5\u5FD7\uFF0C\u5E76\u53EF\u4EE5\u8BBE\u7F6E\u65E5\u5FD7\u683C\u5F0F\u7684\u65B9\u6CD5\uFF1A
#server.tomcat.access-log-enabled=true
#server.tomcat.access-log-pattern=
# accesslog\u76EE\u5F55\uFF0C\u9ED8\u8BA4\u5728basedir/logs
#server.tomcat.accesslog.directory=
# \u65E5\u5FD7\u6587\u4EF6\u76EE\u5F55
#logging.path=H:/springboot-tomcat-tmp
# \u65E5\u5FD7\u6587\u4EF6\u540D\u79F0\uFF0C\u9ED8\u8BA4\u4E3Aspring.log
#logging.file=myapp.log

pom.xml文件


		
		
		
		
		
		
		
			org.springframework.boot
			spring-boot-devtools
			
			true
		
		
			org.springframework.boot
			spring-boot-configuration-processor
			true
		

		
			org.springframework.boot
			spring-boot-starter-data-redis
		

		
			org.springframework.boot
			spring-boot-starter-web
		

		
			org.mybatis.spring.boot
			mybatis-spring-boot-starter
			1.3.2
		
		
			com.alibaba
			druid-spring-boot-starter
			1.1.0
		

		
			org.mybatis.generator
			mybatis-generator-core
			1.3.2
			compile
			true
		
		
		
			tk.mybatis
			mapper-spring-boot-starter
			RELEASE
		
		
			org.springframework.boot
			spring-boot-starter-thymeleaf
		

		
		
			com.alibaba
			fastjson
			1.2.7
		
		
			com.fasterxml.jackson.core
			jackson-databind
			${jackson.version}
		
		
		
			io.springfox
			springfox-swagger2
			2.5.0
		
		
		
			io.springfox
			springfox-swagger-ui
			2.5.0
		
		
			com.belerweb
			pinyin4j
			2.5.0
		
		
		
			javax.mail
			mail
			1.4.5
		

		
			org.apache.shiro
			shiro-core
			1.3.2
		
		
			org.slf4j
			slf4j-nop
			1.7.24
		
		
			log4j
			log4j
			1.2.17
		

		
			mysql
			mysql-connector-java
			runtime
		

		
			org.springframework.boot
			spring-boot-starter-test
			test
		

Springboot整合Thymeleaf和Layui。目前已实现简单的增删改查功能、批量删除功能、以及Echart报表显示与后台的数据交互功能。后面会不断完善。

你可能感兴趣的:(Springboot,Thymeleaf,Layui)