1 添加jar包

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

2 配置文件

server.port=8090
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.cache=false
spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**

3 在templates下新建hello.html

4 新建测试TestController.java

@Controller
public class TestController {
@RequestMapping("/hello")
public String toHello() {
return "hello";
}
}

5 访问页面

6 完成

spriingboot使用thymeleaf的更多相关文章

  1. spring boot(四):thymeleaf使用详解

    在上篇文章springboot(二):web综合开发中简单介绍了一下thymeleaf,这篇文章将更加全面详细的介绍thymeleaf的使用.thymeleaf 是新一代的模板引擎,在spring4. ...

  2. Thymeleaf

    1.在html顶部添加 <html xmlns:th="http://www.thymeleaf.org"> 2.url表达式 @{...} <link rel= ...

  3. Thymeleaf 模板的使用

    Thymeleaf是现代化服务器端的Java模板引擎,不同与JSP和FreeMarker,Thymeleaf的语法更加接近HTML,并且也有不错的扩展性.详细资料可以浏览官网.本文主要介绍Thymel ...

  4. vert.x学习(三),Web开发之Thymeleaf模板的使用

    在vert.x中使用Thymeleaf模板,需要引入vertx-web-templ-thymeleaf依赖.pom.xml文件如下 <?xml version="1.0" e ...

  5. 页面上使用 Thymeleaf 的内联js不当造成了 java.lang.StackOverflowError: null 问题

    由于在页面上内联js使用不当,从而在从 Controller 跳转到页面时发生了以下错误: java.lang.StackOverflowError: null at org.thymeleaf.ut ...

  6. Thymeleaf 与 Javascript

    在 javascript 代码中使用 Thymeleaf 模板引擎: <script th:inline="javascript"> $("#content& ...

  7. Thymeleaf+SpringMVC,如何从模板中获取数据

    Thymeleaf+SpringMVC,如何从模板中获取数据 在一个典型的SpringMVC应用中,带@Controller注解的类负责准备数据模型Map的数据和选择一个视图进行渲染.这个模型Map对 ...

  8. Thymeleaf+Spring整合

    前言 这个教程介绍了Thymeleaf与Spring框架的集成,特别是SpringMvc框架. 注意Thymeleaf支持同Spring框架的3.和4.版本的集成,但是这两个版本的支持是封装在thym ...

  9. thymeleaf常用标签

    1. th:checked ,th:selected标签<input type="radio" value="M" name="gender&q ...

随机推荐

  1. makefile那些事儿

    一.好处 自动化编译,一条make命令,整个工程可以完全自动编译,make命令是构建大型项目的首选方案. makefile就像一个shell脚本一样,用来定义规则,一个名称包含一条或多条命令,在终端m ...

  2. java基础:

    java基础: 内容. 待续........

  3. 学习 Git Rebase

    有问题为什么不问问神奇的 man 呢? rebase 也算是我比较常用的一个指令了,但是很长时间以来,对这个指令的认识还是不够深刻,于是就找了个时间认真地读了一下 git rebase 的文档.这份文 ...

  4. InvokeMember 使用(转http://blog.csdn.net/gooer/article/details/2927113)

    函数原型:       public   object   InvokeMember(string,   BindingFlags,   Binder,   object,   object[]); ...

  5. zabbix 后台数据库清除数据

    alerts 表 problem 表 escalations 表 events 表  event_recovery表 对 这些表进行清除 防止不停发送邮件 -- alerts table rebuil ...

  6. Oracle Spatial分区应用研究之五:不同分区粒度+本地空间索引效率对比

    1.实验目的 若使用本地空间索引,不同分区粒度将产生不同索引组织,其索引分区个数.大小.R-TREE树结构均不相同.那么,在什么分区粒度下的本地空间索引效率较高呢? 2实验数据 实验数据为全国2531 ...

  7. JVM知识点总览-高级Java工程师面试必备

    jvm 总体梳理 jvm体系总体分四大块: 类的加载机制 jvm内存结构 GC算法 垃圾回收 GC分析 命令调优 当然这些知识点在之前的文章中都有详细的介绍,这里只做主干的梳理 这里画了一个思维导图, ...

  8. openjudge4979 - 海贼王之伟大航路 题解

    原题链接 题目简要分析 N个点,从1号点到N号点求最短路径,且每个点都要遍历到.现在要你求出最优方案. 这道题看到后,首先的想法莫过于搜索.暴力了.这显然不太可能.而进一步思考,使用Floyed和Di ...

  9. php开发工程师都需要掌握什么技能呢?

    PHP原生标准库精通,三种大型框架中熟练掌握一门的开发(Symfony2.Yii.ZF2),小型框架中(Codeigniter 等)通读其一源码. MySQL语句精通,实践构造 1000 万级的数据库 ...

  10. go开发环境

    1.go 下载地址 https://studygolang.com/dl 根据操作系统 下载相应的安装包 2.设置环境变量 goroot gopath path 增加%goroot%\bin 3.开发 ...