Struts 2文本字段将撇号转换为“'". [英] Struts 2 textfield convert apostrophe to "&#39 ;"
本文介绍了Struts 2文本字段将撇号转换为“'".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用已保存的值填充名称文本字段.
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 "' ;
".
例如. sdsd'sds
==> sdsd' ;sds
escape
属性不起作用.
我该怎么办?
推荐答案
此问题已通过使用ESAPI.encoder().decodeForHTML()函数得到解决. 在s:textfields中使用之前,对这些值进行解码后,这些值将正确呈现.
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.
谢谢.
这篇关于Struts 2文本字段将撇号转换为“'".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文