首页 > 编程语言 > 详细

java之thymeleaf使用

时间:2019-05-08 12:34:59      阅读:289      评论:0      收藏:0      [点我收藏+]

pom.xml增加如下配置

<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
    <version>2.1.4.RELEASE</version>
</dependency>

 

application.properties增加如下配置

#thymelea模板配置
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.servlet.content-type=text/html
#热部署文件,页面不产生缓存,及时更新
spring.thymeleaf.cache=false
spring.resources.chain.strategy.content.enabled=true
spring.resources.chain.strategy.content.paths=/**

 

thymeleaf表达式语法参考:

https://www.jianshu.com/p/908b48b10702

 

java之thymeleaf使用

原文:https://www.cnblogs.com/glzgc/p/10830987.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!