SpringBoot进行web开发-引入thymeleaf

 时间:2024-11-21 23:44:17

1、springboot内嵌使用tomcat服务器,所以默认的jsp页面语法不能使用。

SpringBoot进行web开发-引入thymeleaf

2、springboot默认是不支持静态页面的。springboot推荐使用Thymeleaf模板引擎。

SpringBoot进行web开发-引入thymeleaf

3、首先在pom.垓矗梅吒xml引入thymeleaf相关的依赖包。<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>

SpringBoot进行web开发-引入thymeleaf

4、如果我们需要使用更高版本的thymeleaf的版本,只需要在properties中设置版本属性即可。

SpringBoot进行web开发-引入thymeleaf

5、这样配置之后就可以覆盖我们springboot父类的thymeleaf属性配置。

SpringBoot进行web开发-引入thymeleaf

6、thymeleaf模板引擎的语法比freemarker和volicity模板引擎功能更强大,使用起来更加方便。

SpringBoot进行web开发-引入thymeleaf
  • 怎样在Springboot中使用Thymeleaf实现动态网页
  • springboot中如何使用thymeleaf生成静态页面
  • SpringBoot健康检查的使用
  • SpringBoot集成Redis
  • iBase4J SpringBoot版本的部署和执行
  • 热门搜索
    小孩便秘怎么调理 淋巴细胞百分比偏高是怎么回事 简单盘发发型扎法 经济的近义词 包括的近义词 新电脑怎么联网 钙尔奇怎么吃 平常的近义词 欧神诺瓷砖质量怎么样 颜料干了怎么办