views:

829

answers:

2

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 use: 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!

A: 

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

lucentmind
A: 

Thanks lucentmind and BalusC foryour repliees

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

**taula d \''usuaris**

Thanks

Moli