Barry
Barry

Reputation: 1820

struts 2 s:property tag

I have a list of strings that I output to a JSP page. I use a combination of s:iterate followed by s:property to write out the list of strings to the page. Some of the strings contain HTML formatting but currently they get written to the page as text and not rendered as HTML. How can I output this text to the page with the HTML rendered.

For example (incase the HTML renders I am not writing appropriate tags below)

some text more text this should be [bold]in bold[/bold]

Upvotes: 1

Views: 4306

Answers (1)

Dustin Wilhelmi
Dustin Wilhelmi

Reputation: 1839

Add the escape attribute, like so:

<s:property value="myvar" escape="false" />

This tells struts not to escape the html inside the property.

Upvotes: 4

Related Questions