使用th:placeholder的未转义文本 [英] Unescaped Text with th:placeholder

查看:177
本文介绍了使用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=&Uacute;ltimo nome

问题是应用程序无法解析& Uacute; Ú。当我使用 th:utext 时,我对此没有任何问题。

the problem is the application don't resolve the &Uacute; 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 &Uacute 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屋!

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