成都创新互联网站制作重庆分公司

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=/**

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持创新互联。


网站栏目:springboot2.1.7整合thymeleaf代码实例
新闻来源:http://cxhlcq.com/article/gihjoo.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部