0

I'm having trouble because of the escape string issue.

The value stated in action is like below:

myVo.title = "[M&M]Title";

And I want to use it in JSP like below:

<s:textfield name="title" id="title" value="%{myVo.title}" />

but what I got is this:

enter image description here

I searched about this problem, but I got no clear answer.

There're some attributes for escape issue like escape/ecapeHtml/escapeXml

but those all are for property tag, not for textfield tag.

How can I solve this problem?

Any comment would be appreciated. Thanks.

qumm
  • 137
  • 1
  • 13
  • Add ` ` tags or use charcter code instead of symbol `&` – Sumesh TG Aug 14 '18 at 08:54
  • Check https://stackoverflow.com/questions/34436841/struts-2-textfield-convert-apostrophe-to-39 or https://stackoverflow.com/questions/2428572/how-do-i-escape-a-single-quote?rq=1 – Sheetal Mohan Sharma Aug 14 '18 at 08:58
  • 1
    @SumeshTG Thanks for the comment. But the first way does not work. And the second way, I can't because the string data comes from DB. – qumm Aug 16 '18 at 00:20
  • If you know the possible symbols you can easily replace them with Unicode corresponding to each character – Sumesh TG Aug 16 '18 at 12:58

1 Answers1

0

You have to disable escape like this:

<s:textfield name="title" id="title" value="%{myVo.title}" escape="false"/>
xpiero
  • 65
  • 7