gpt4 book ai didi

java - struts2 i18n java属性,如何转义字符?

转载 作者:搜寻专家 更新时间:2023-10-31 20:16:17 25 4
gpt4 key购买 nike

我不知道如何在 java 属性文件中转义 '。我正在使用 struts2 和 getText 函数来填充 i18n 和文本标签。

例如我使用:config.users.title= taula d'usuaris ---> config.users.title= taula d\'usuaris

但在我的 JSP 中,我得到:taula dusuaris。

我用它在我的 JSP 上显示文本:

<label for="title"><s:text name="config.users.title" />:</label>

我有时也会使用:

<s:select id="categories"  name="categories"  headerKey="" 
headerValue="%{getText('map.categories.all')}"
list="categories" listKey="id" listValue="name"/>

错误是什么?

谢谢!

最佳答案

感谢lucentmind和BalusC的回复

解决方案是这样的:在我的属性文件中,我将 ' 引用为\'' 并且工作正常。

**taula d \''usuaris**

谢谢

关于java - struts2 i18n java属性,如何转义字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2298290/

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