1、在springboto项目中使用thymeleaf标签,必须先添加依赖,如下。

<dependency>
  1. <groupId>org.springframework.boot</groupId>
  2. <artifactId>spring-boot-starter-thymeleaf</artifactId>
  3. </dependency>

2、在application.properties中配置一些常用的thymeleaf,如下。

spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.check-template-location=true spring.thymeleaf.suffix=.html spring.thymeleaf.encoding=UTF-8 spring.thymeleaf.content-type=text/html spring.thymeleaf.mode=HTML5 spring.thymeleaf.cache=false

可参考博客:https://blog.csdn.net/ice_lemon_g/article/details/73609020

thymeleaf的配置的更多相关文章

  1. SpringBoot第三节(thymeleaf的配置与SpringBoot注解大全)

    Springboot默认是不支持JSP的,默认使用thymeleaf模板引擎.所以这里介绍一下Springboot使用Thymeleaf的实例以及遇到的问题. 1.配置与使用 1.1:在applica ...

  2. Spring MVC 5 + Thymeleaf 基于Java配置和注解配置

    Spring MVC 5 + Thymeleaf 注解配置 Spring的配置方式一般为两种:XML配置和注解配置 Spring从3.0开始以后,推荐使用注解配置,这两种配置的优缺点说的人很多,我就不 ...

  3. SpringBoot整合Jsp和Thymeleaf (附工程)

    前言 本篇文章主要讲述SpringBoot整合Jsp以及SpringBoot整合Thymeleaf,实现一个简单的用户增删改查示例工程.事先说明,有三个项目,两个是单独整合的,一个是将它们整合在一起的 ...

  4. Spring Boot 2.0 配置图文教程

    摘要: 原创出处 https://www.bysocket.com 「公众号:泥瓦匠BYSocket 」欢迎关注和转载,保留摘要,谢谢! 本章内容 自定义属性快速入门 外化配置 自动配置 自定义创建 ...

  5. 从.Net到Java学习第九篇——SpringBoot下Thymeleaf

    从.Net到Java学习系列目录 Thymeleaf概述 Thymeleaf 是一个流行的模板引擎,该模板引擎采用java语言开发.模板引擎是一个技术名称,是跨领域平台的概念,在java语言体系下有模 ...

  6. SpringBoot系列——Thymeleaf模板

    前言 thymeleaf是springboot官方推荐使用的java模板引擎,在springboot的参考指南里的第28.1.10 Template Engines中介绍并推荐使用thymeleaf, ...

  7. Spring Boot自动配置与Spring 条件化配置

    SpringBoot自动配置 SpringBoot的自动配置是一个运行时(应用程序启动时)的过程,简化开发时间,无需浪费时间讨论具体的Spring配置,只需考虑如何利用SpringBoot的自动配置即 ...

  8. SpringBoot集成前端模版(thymeleaf)

    1.在application.properties配置文件中添加 thymeleaf 的配置信息 spring.datasource.driverClassName=com.mysql.jdbc.Dr ...

  9. thymeleaf(二)

    项目demo     http://pan.baidu.com/s/1wg6PC 学习资料网址  http://www.blogjava.net/bjwulin/archive/2013/02/07/ ...

随机推荐

  1. 网页开发--03(wampserver安装服务无法启动的问题)

    一.安装wampserver 一路next,指定安装路径外,其它默认安装. 二.我遇到的问题 当任务图标绿色为正常启动状态,但是我的从打开一直是黄色,问题在于Apache和MySql 1)Apache ...

  2. CoreProfiler升级到.NetStandard 2.0

    致所有感兴趣的朋友: CoreProfiler和相应的Sample项目cross-app-profiling-demo都已经升级到.NetStandrard 2.0和.NetCore 2.0. 有任何 ...

  3. Tomcat 集群中 实现session 共享的三种方法

    前两种均需要使用 memcached 或 redis 存储 session ,最后一种使用 terracotta 服务器共享. 建议使用 redis ,不仅仅因为它可以将缓存的内容持久化,还因为它支持 ...

  4. [Swift]LeetCode173. 二叉搜索树迭代器 | Binary Search Tree Iterator

    Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the ro ...

  5. [Swift]LeetCode636. 函数的独占时间 | Exclusive Time of Functions

    Given the running logs of n functions that are executed in a nonpreemptive single threaded CPU, find ...

  6. PostgreSQL基础知识分享

    1.架构 PostgreSQL是一个关系数据库,采用c/s架构.一个PostgreSQL会话包括: 服务端进程——postgres:用于管理数据库文件,并接受来自客户端的数据库连接, 同时代替客户端执 ...

  7. ubuntu18下安装docker

    1.通过指令检查linux内核 uname -a  可以看到大于3.10版本 2.检查是否存在对应目录 ls -l /sys/class/misc/device-mapper 3. apt-get指令 ...

  8. 课程五(Sequence Models),第三周(Sequence models & Attention mechanism) —— 2.Programming assignments:Trigger word detection

    Expected OutputTrigger Word Detection Welcome to the final programming assignment of this specializa ...

  9. AI 这么优秀,连我鉴黄师的饭碗都抢了

    色情行业,或许是对信息渠道最敏锐.利用各类信息渠道进行传播最“充分”的“行业”.这些年,社交 App.直播.短视频等新的互联网应用方式,都难逃色情内容的“骚扰”.哪里人多,色情内容就能立刻扑过去,在海 ...

  10. 使用QuertZ组件来搞项目工作流(一)

    前言:抛弃windows计划,拥抱.NET组件.每个人都喜欢监听和插件.今天,几乎下载任何开源框架,你必定会发现支持这两个概念.监听是你创建的C#类,当关键事件发生时会收到框架的回调.例如,当一个作业 ...