问题
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}"/>
the value for account.sobrenome
is placed on file message.properties
:
account.sobrenome=Último nome
the problem is the application don't resolve the Ú
to Ú
. When I use th:utext
, i have no problems with this.
Anyone know how to use unescaped text with this tag th:placeholder?
回答1:
The issue is Spring Message treat Ú
as seperate &
U
a
c
u
t
e
letters and not as Ú
.
Change the message to unicode as below
account.sobrenome=\u00daltimo nome
and use
th:placeholder="#{account.sobrenome}"
来源:https://stackoverflow.com/questions/32501163/unescaped-text-with-thplaceholder