
Thymeleaf
文章平均质量分 73
Thymeleaf是一个模板引擎,主要用于编写动态页面。
旭东怪
这个作者很懒,什么都没留下…
展开
-
Thymeleaf 导入公共页面内容两种方式(th:replace,th:include)
1 公共页面(subPage/head.html)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.w3.org/1999/xhtml" xml:lang="en"&原创 2020-08-30 17:29:48 · 4846 阅读 · 0 评论 -
Thymeleaf Error resolving template [favicon.ico], template might not exist问题解决
问题描述:org.thymeleaf.exceptions.TemplateInputException: Error resolving template [favicon.ico], template might not exist or might not be accessible by any of the configured Template Resolvers问题分析:Thymeleaf进行解析视图的时候,默认会查找一个叫favicon.ico的文件,如果找不到就会报错。可以使用原创 2020-08-30 08:50:55 · 3863 阅读 · 1 评论 -
Spring Boot配置Thymeleaf模版引擎
1 文件目录2 pom.xml导入thymeleaf依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependency>3 application.properties加入thymeleaf配置# 后缀spri.原创 2020-08-30 08:42:38 · 771 阅读 · 0 评论 -
Thymeleaf 修改页面内容之后实时生效两种方法(热部署,手动编译)
1 禁用Thymeleaft模板引擎的缓存# 开发时关闭缓存,不然没法看到实时页面spring.thymeleaf.cache=false2 实时生效本人总结了两种方法使页面内容实时生效。(1)手动编译页面修改完后,按Ctrl+F9,重新编译。(2)热部署这种方法的好处是不需要自己手动编译。页面修改之后,刷新页面就能看到效果。Spring Boot实现热部署注:这两种方法都需要设置spring.thymeleaf.cache=false。...原创 2020-08-30 08:30:58 · 1915 阅读 · 0 评论 -
Thymeleaf Error resolving template [index],template might not exist or might not be accessible问题解决
问题描述:# 后缀spring.thymeleaf.prefix=classpath: /templates# 模板格式spring.thymeleaf.mode=HTML5spring.thymeleaf.encoding=UTF-8spring.thymeleaf.content-type=text/htmlspring.thymeleaf.suffix=.html# 开发时关闭缓存,不然没法看到实时页面spring.thymeleaf.cache=false以上为我的thym原创 2020-08-29 22:07:48 · 13748 阅读 · 5 评论