Springboot+Mybatis+Thymeleaf
工具Eclipse 2018
Maven 配置
ThymeLeaf 安装: https://blog.csdn.net/xingqibaing/article/details/82787164
spring项目创建:https://www.cnblogs.com/LUA123/p/8110285.html
https://www.jb51.net/article/144068.htm
https://blog.csdn.net/wangjiankai1993/article/details/80272886
controller、Service层讲解 https://www.jianshu.com/p/06376b97b11e
1、选择项目类型

2、设置项目

3、项目结构

4、创建HelloController

package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/")
public String hello() {
return "Welcome to start SpringBoot!";
}
}
5、pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>spring-boot2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-boot2</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
6、启动

运行结果

7、添加MyBatis、Thymeleaf依赖
Thymeleaf 安装: https://blog.csdn.net/xingqibaing/article/details/82787164
Thymeleaf入门使用: https://blog.csdn.net/love_everybody/article/details/79870035
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
注意:运行报 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
由于依赖了mybatis-spring-boot-starter,此时还未配置数据源,在运行时需先配置数据源。
Springboot+Mybatis+Thymeleaf的更多相关文章
- Docker+SpringBoot+Mybatis+thymeleaf的Java博客系统开源啦
个人博客 对于技术人员来说,拥有自己的个人博客应该是一件令人向往的事情,可以记录和分享自己的观点,想到这件事就觉得有意思,但是刚开始写博客的时候脑海中是没有搭建个人博客这一想法的,因为刚起步的时候连我 ...
- 从零开始搭建springboot+mybatis+thymeleaf增删改查示例
环境说明: 开发工具:Eclipse Mars.2 Release(4.5.2) JDK:1.8 Maven:3.3.3 注:Eclipse需安装sts插件,安装方法请自行百度 1. 新建maven工 ...
- springboot+mybatis+thymeleaf+docker构建的个人站点开源项目(集成了个人主页、个人作品、个人博客)
前言 My Site 主要功能有:个人首页.个人作品.个人博客为一体的站点,网站的文章和作品均由markdown进行编写,可以满足你的基本需求.如果觉得这个项目不错,请为它点赞支持. 项目架构 JDK ...
- springboot+mybatis+thymeleaf项目搭建及前后端交互
前言 spring boot简化了spring的开发, 开发人员在开发过程中省去了大量的配置, 方便开发人员后期维护. 使用spring boot可以快速的开发出restful风格微服务架构. 本文将 ...
- 【SpringBoot+Mybatis+thymeleaf报错】Error resolving template "XXX", template might not exist or might not be accessible by any of the configured
解决方法一: 原因:在使用springboot的过程中,如果使用thymeleaf作为模板文件,则要求HTML格式必须为严格的html5格式,必须有结束标签,否则会报错. 在application.y ...
- spring-boot + mybatis +pagehelper 使用分页
转自:https://segmentfault.com/a/1190000015668715?utm_medium=referral&utm_source=tuicool 最近自己搭建一个sp ...
- 【SpringBoot】SpringBoot/MyBatis/MySql/thymeleaf/Log4j整合工程
工程下载地址:https://files.cnblogs.com/files/xiandedanteng/MMSpringWeb20191027-1.rar 工程目录结构如图: 1.创建工程 有些网文 ...
- Thymeleaf+SpringBoot+Mybatis实现的家庭财务管理系统
项目简介 项目来源于:https://gitee.com/darlingzhangsh/graduation_project 本系统是基于Thymeleaf+SpringBoot+Mybatis.是非 ...
- Thymeleaf+SpringBoot+Mybatis实现的齐贤易游网旅游信息管理系统
项目简介 项目来源于:https://github.com/liuyongfei-1998/root 本系统是基于Thymeleaf+SpringBoot+Mybatis.是非常标准的SSM三大框架( ...
随机推荐
- React条件渲染
传参判断 class LoginControl extends React.Component { constructor(props) { super(props); this.handleLogi ...
- phpstorm 实现SFTP开发,线上线下同步(实时更新代码)
https://blog.csdn.net/zz_lkw/article/details/79711746
- python中网络编程之线程
网络编程之线程 什么是线程? 程序的执行线路.每个进程默认有一条线程.线程包含了程序的具体步骤. 多线程就是一个进程中有除主线程(默认线程)外还有多个线程. 线程与进程的关系(进程包含线程,而线程依赖 ...
- ARTS打卡计划第一周-Tips-ControllerAdvice的使用
通常在开发具体项目过程中我们可能会面临如下问题: 统一所有的json返回结果 统一处理所有controller中的异常,并且给不同异常不同的返回状态值 统一对返回的接口做数据校验或者加密,防止篡改 在 ...
- display:flex布局
/*背景 居中 自适应 铺满容器*/ background: center / cover; flex布局是什么? flex是Flexibe Box 的缩写,意思为”弹性布局”, 用来为盒子模型提供最 ...
- java课程之团队开发冲刺1.6
一.总结昨天进度 1.依照视频学习了sqlite,但是由于视频的不完整性导致并不知道代码的实际效果怎么样. 二.遇到的问题 1.依据上一条,在date目录下date文件夹中,的确发现了数据库的文件,但 ...
- window备忘录
1.window.name属性是一个字符串,表示当前窗口的名字,只有当浏览器窗口关闭的时候,此属性才会消失. 2.window.closed属性返回一个布尔值,表示窗口是否关闭.此属性一般用来检查使用 ...
- failed to find global analyzer [uax_url_email]
ES的默认分词设置是standard,这个在中文分词时就比较尴尬了,会单字拆分,比如我搜索关键词“清华大学”,这时候会按“清”,“华”,“大”,“学”去分词,然后搜出来的都是些“清清的河水”,“中华儿 ...
- Java框架spring 学习笔记(十九):事务管理(注解管理)
注解管理的方式要比xml配置方式要简单很多 只需在配置文件中添加事务注解 <?xml version="1.0" encoding="UTF-8"?> ...
- 拦截过滤防御XSS攻击 -- Struts2.3 以及 2.5 的解决方式
使用Struts2框架开发的后台在防御XSS攻击的时候很多方式都不能用,因为Struts2对请求进行的二次封装有区别.以下针对Struts2的XSS攻击进行拦截过滤防御解决: Struts2.3 本方 ...