3

I have a simple text stored in the database record: Hello wrapped in an h1 tag.

When I print this record in the JSP with the <s:property /> tag, it displays:

<h1>Hello</h1>

While I want it to be displayed like:

Hello

How can I get the interpreted value, instead of the source value ?

Vy Do
  • 46,709
  • 59
  • 215
  • 313
  • Can you please be more specific and add some code you already have tried. Else nobody will understand your problem. – Johannes Apr 29 '15 at 08:17
  • possible duplicate of [How to include HTML in OGNL expression language in Struts 2](http://stackoverflow.com/questions/26684025/how-to-include-html-in-ognl-expression-language-in-struts-2) – Roman C Apr 29 '15 at 09:10

1 Answers1

2

You need to set the escapeHtml attribute of the <s:property/> tag to false because, for security reasons, it is true by default:

<s:property value="myVar" escapeHtml="false" />

Read more on the docs.

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243