需要在Thymeleaf中使用JSP标记等效项

问题描述 投票:0回答:1

我是Thymeleaf的新手。在jsp世界中,我可以使用jsp的“ head”中的以下标签来更改Springboot Web Application的主题:

<spring:theme code="stylesheet" var="themeName" />
<link href='<spring:url value="css/${themeName}"/>' rel="stylesheet" />

如果我要使用“ Thymeleaf模板”而不是jsp,我应该写“与上述完全相同的东西吗?我正在使用(并且必须使用)Spring Boot(用于Web和数据)。有人可以指出我的出路吗?

spring-boot spring-mvc spring-data-jpa thymeleaf
1个回答
0
投票

您始终可以在Thymeleaf中构建动态URL,例如:

© www.soinside.com 2019 - 2024. All rights reserved.