gpt4 book ai didi

thymeleaf - 自定义mailto : link using Thymeleaf

转载 作者:行者123 更新时间:2023-12-03 22:53:51 29 4
gpt4 key购买 nike

我正在使用 Spring 和 Thymeleaf 处理项目。
我有用户列表。我想使用mailto创建联系链接:

<a href="mailto:name@email.com">

我正在显示这样的用户列表:
<tr th:each="users : ${users}">
<td th:text="${users.id}"></td>
<td th:text="${users.firstname}"></td>
<td th:text="${users.lastname}"></td>
<td th:text="${users.email}"></td>
</tr>

所以我想要实现的是 mailto 适合每个新教授和他的电子邮件,而无需我手动编写。
我在想是否可以写这样的东西:
<td><a th:href = "mailto:${users.email}">

最佳答案

试试下面的代码:

<td><a th:href="'mailto:' + ${users.email}">Send email </a></td>

关于thymeleaf - 自定义mailto : link using Thymeleaf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45695060/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com