开发者

struts2 i18n java properties, how to escape characters?

开发者 https://www.devze.com 2022-12-21 03:40 出处:网络
I don\'t know how to escape \' in a java properties file. I\'m using struts2 and getText function to fill i18n and text tags.

I don't know how to escape ' in a java properties file. I'm using struts2 and getText function to fill i18n and text tags.

For example I us开发者_开发技巧e: config.users.title= taula d'usuaris ---> config.users.title= taula d\'usuaris

But in my JSP, I get : taula dusuaris.

I use this to display text on my JSP:

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

Also I sometimes I use:

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

What's the error?

Thanks!


Thanks lucentmind and BalusC foryour repliees

the solution was this: on my properties file I quoted ' as \'' and works fine.

**taula d \''usuaris**

Thanks


try to use double quote as escape character to show single quote on HTML page.

so you can mention value in propertis file like this : taula d "\'"usuaris

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号