Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Escape string using Struts2 tags

I am trying to escape characters

<s:select list="#{'Achat d'eclair':'Achat d'eclair'}" />

How can I escape Achat d'eclair in Struts2 tags ?

like image 478
John Avatar asked Sep 28 '22 06:09

John


1 Answers

First of all with #{} notation you're creating a map where value before : is a key and after is a value and you probably don't want that the key of your map would be with some complex characters in it.

To escape ' use \\ like so:

<s:select list="#{'achatdeclair':'Achat d\\'eclair'}" />
like image 55
Aleksandr M Avatar answered Oct 13 '22 02:10

Aleksandr M