springboot2.1.7整合thymeleaf代码实例

网友投稿 247 2022-12-18


springboot2.1.7整合thymeleaf代码实例

这篇文章主要介绍了springboot2.1.7整合thymeleaf代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下

1.在pom里面添加thymeleaf依赖

org.springframework.boot

spring-boot-starter-thymeleaf

nekohtml

nekohtml

${nekohtml.version}

2.添加application.properties配置

spring.thymeleaf.prefix=classpath:/templates/

spring.thymeleaf.check-template-location=true

spring.thymeleaf.suffix=.html

spring.thymeleaf.encoding=UTF-8

spring.thymeleaf.servlet.content-type=text/html

spring.thymeleaf.mode=HTML5

spring.thymeleaf.cache=false

spring.resources.chain.strategy.content.enabled=true

spring.resources.chain.strategy.content.paths=/**


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:Java8方法引用和构造引用代码实例
下一篇:5分钟快速学会spring boot整合JdbcTemplate的方法
相关文章

 发表评论

暂时没有评论,来抢沙发吧~