thymeleaf命名空间和依赖导入

本文介绍了Thymeleaf,一个用于Web和独立环境的现代服务器端Java模板引擎。它强调自然模板语法,使得HTML文档在没有被模板引擎处理时也能正常工作。在Spring Boot应用中,Thymeleaf可以与Spring Security进行整合,提供安全控制。通过添加特定的命名空间如`<sec>`,可以实现权限控制等功能。要开始使用Thymeleaf,可以在项目中引入相应的Maven依赖,例如`spring-boot-starter-thymeleaf`、`thymeleaf-spring5`和`thymeleaf-extras-java8time`。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

thymeleaf是一个模板引擎
thymeleaf命名空间
<html lang="en" xmlns:th="http://www.thymeleaf.org">
thymeleaf和spring security整合命名空间:
xmlns:sec="http://www.w3.org/1999/xhtml"

推荐自行去网站
https://mvnrepository.com/
内搜索需要的最新版本的依赖。

 <!--thymeleaf启动器坐标-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
<dependency>
	<groupId>org.thymeleaf</groupId>
	<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
	<groupId>org.thymeleaf.extras</groupId>
	<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值