Reputation: 1877
I am trying to populate name text field with already saved value.
Now the value can contain apostrophe. But text fields is converting apostrophe to "' ;
".
Eg. sdsd'sds
==> sdsd' ;sds
escape
property for textfield is not working.
What should I do?
Upvotes: 2
Views: 888
Reputation: 1877
This issue got resolved with use of ESAPI.encoder().decodeForHTML() function. The values getting rendered properly after I decode the values before using in s:textfields.
Thanks.
Upvotes: 0
Reputation: 50203
You are probably escaping it server-side.
Don't.
Struts will take care of this.
You only need to specify when you want the opposite (getting the unescaped value in the <s:property />
tag) using the escapeHtml="false"
property.
P.S: there are characters that need a special threatment like the € (euro symbol), but it's another story.
Upvotes: 0
Reputation: 1383
You are getting this because of Encoding feature.
To avoid this and get exactly same as you want, you have to use HtmlDecode
which is available in util package of java.
Upvotes: 1