How to display HTML snippets using Property Tag in Struts 2.


Struts2Logo

Suppose your's HTML snippet is stored in Database and you are getting HTML snippet using POJO in Action class.If you display HTML snippet using Property Tag like this:

<s:property  value="articleContent" />

your output will be like this:  <p>This is for article<p><br/><h3>Gym<h3>  means your  HTML tags are still being escaped. So to solve this problem you have to turn off escaping:

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

Share on Google Plus

About JK STACK

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment