使用th:placeholder的未转义文本 [英] Unescaped Text with th:placeholder
问题描述
在当前的spring-boot / thymeleaf中,某些html视图具有一种形式,其中存在这样的字段:
In the current spring-boot / thymeleaf, some of the html views have a form where a field with like this is present:
<input type="text" name="sobrenome" class="form-control" th:placeholder="#{account.sobrenome}"/>
放置 account.sobrenome
的值文件 message.properties
:
account.sobrenome=Último nome
问题是应用程序无法解析& Uacute;
到Ú
。当我使用 th:utext
时,我对此没有任何问题。
the problem is the application don't resolve the Ú
to Ú
. When I use th:utext
, i have no problems with this.
任何人都知道如何将未转义的文本与这个标签th:placeholder?
Anyone know how to use unescaped text with this tag th:placeholder?
推荐答案
问题是Spring Message对待& Uacute
作为单独的&
U
a
c
u
t
e
字母,而不是Ú
。
The issue is Spring Message treat Ú
as seperate &
U
a
c
u
t
e
letters and not as Ú
.
将消息更改为 unicode ,如下所示
Change the message to unicode as below
account.sobrenome=\u00daltimo nome
并使用
th:placeholder="#{account.sobrenome}"
这篇关于使用th:placeholder的未转义文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!