How to correctly display HTML markup content from database to browser in Struts 2?

I have a simple text stored in a database record: Hello

wrapped in a tag h1


When I print this post to a JSP with a tag <s:property />

, it displays:



For now, I want it to display like this:


How do I get the interpreted value instead of the original value?


source to share

1 answer

You need to set the escapeHtml

tag attribute <s:property/>

to false

, because for security reasons it true

is the default:

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


More details in the docs .



All Articles