Search code examples
struts2escapingtextfieldencodeesapi

Struts 2 textfield convert apostrophe to "&#39 ;"


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 "&#39 ;".

Eg. sdsd'sds ==> sdsd&#39 ;sds

escape property for textfield is not working.

What should I do?


Solution

  • 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.