在注释中使用变量/表达式(在 Thymeleaf 模板中) [英] Using variables/expressions in comments (in Thymeleaf template)

查看:35
本文介绍了在注释中使用变量/表达式(在 Thymeleaf 模板中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在页面中添加一些关于生成的信息.

I need to add some information about generation in page.

</html>
<!-- page [[${pageCode}]] was generated at [[${#dates.format(currentDate, ‘dd/MMM/yyyy HH:mm’)}]]  -->

但对我来说它不起作用.我应该配置一些东西还是用另一种方式来做?

But for me it don't work. Should I configure something or do it in another way ?

推荐答案

您正在寻找下面的第一个示例.

You are looking for the first sample below.

模板标记 1

<span th:inline="text" th:remove="tag" >
   <!-- page [[${pageCode}]] was generated at [[${#dates.format(currentDate, ‘dd/MMM/yyyy HH:mm’)}]]  -->
</span>

结果 1<!-- 页面 [[${pageCode}]] 生成于 [[${#dates.format(currentDate, 'dd/MMM/yyyy HH:mm')}]] -->

模板标记 2

<span th:text="inline" th:remove="tag" >
   <!-- page [[${pageCode}]] was generated at [[${#dates.format(currentDate, ‘dd/MMM/yyyy HH:mm’)}]]  -->
</span>

结果 2 inline

这篇关于在注释中使用变量/表达式(在 Thymeleaf 模板中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆