gpt4 book ai didi

thymeleaf - 如何转义 HTML :errors?

转载 作者:行者123 更新时间:2023-12-01 22:53:57 25 4
gpt4 key购买 nike

假设我有:

<span th:if="${#fields.hasErrors('firstName')}" class="color--error" th:errors="*{firstName}"></span>

如果错误文本包含 HTML,如何转义文本?我知道对于普通文本,我们可以使用 th:utext

最佳答案

3.0.8-SNAPSHOT 开始,Thymeleaf-Spring 出现 th:uerrors

请参阅此 GitHub 问题进行讨论:https://github.com/thymeleaf/thymeleaf-spring/issues/153

3.0.8 的更改日志:http://forum.thymeleaf.org/Thymeleaf-3-0-8-JUST-PUBLISHED-td4030687.html

关于thymeleaf - 如何转义 HTML :errors?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48045054/

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