博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SpringBoot系列之集成Thymeleaf模板引擎
阅读量:2041 次
发布时间:2019-04-28

本文共 662 字,大约阅读时间需要 2 分钟。

简单介绍

目前在JavaEE领域有几中比较常用的模板引擎,分别是Jsp、Velocity、Freemarker、Thymeleaf,对Freemark语法不是特别熟悉,不过对于前端页面渲染效率来说,jsp其实还是最快的,Velocity次之。Thymeleaf虽然渲染效率不是很快,但是语法方面是比较轻巧的,Thymeleaf语法比Velocity轻巧,但是渲染效率不如Velocity

maven配置

因为引入了SpringBoot的parent工程,所以不需要写版本号

org.springframework.boot
spring-boot-starter-thymeleaf

application.yml配置

#添加Thymeleaf配置  thymeleaf:    cache: false    prefix: classpath:/templates/    suffix: .html    mode: HTML5    encoding: UTF-8    content-type: text/html

application.yml:

server:  port: 8081#logging:#  config: classpath:logback_spring.xml.bat#  level:#    com.muses.taoshop: debug#  path: /data/lo

转载地址:http://zfcof.baihongyu.com/

你可能感兴趣的文章
(计蒜客)利用栈实现表达式转换并求得结果
查看>>
木板灌水问题(单调栈)
查看>>
逆波兰式的转换与计算(简单)
查看>>
进制计算与转换
查看>>
二进制数的源码,反码,补码
查看>>
(PAT) 1051 Pop Sequence
查看>>
(计蒜客)骑马走江湖(BFS加剪枝)
查看>>
(模板 重要)Tarjan算法解决LCA问题(PAT 1151 LCA in a Binary Tree)
查看>>
(PAT 1125) Chain the Ropes (贪心+优先级队列的应用)
查看>>
1013 Battle Over Cities (DFS+连同分量)
查看>>
(PAT 1154) Vertex Coloring (图的广度优先遍历)
查看>>
(PAT 1115) Counting Nodes in a BST (二叉查找树-统计指定层元素个数)
查看>>
(PAT 1143) Lowest Common Ancestor (二叉查找树的LCA)
查看>>
(PAT 1061) Dating (字符串处理)
查看>>
(PAT 1118) Birds in Forest (并查集)
查看>>
数据结构 拓扑排序
查看>>
(PAT 1040) Longest Symmetric String (DP-最长回文子串)
查看>>
(PAT 1145) Hashing - Average Search Time (哈希表冲突处理)
查看>>
(1129) Recommendation System 排序
查看>>
PAT1090 Highest Price in Supply Chain 树DFS
查看>>