I have a string var in my Struts2 action, like this:
String tmp = "<br/>";
I want to print it out to the html page as HTML tag by JSP, like this:
<s:property value="tmp"/>
But, in the html page, the < and > was translated to < and > which i don’t want to.
So how should I do this?
<s:property>has anescapeattribute which determines if the value is HTML-escaped. The default istrue, so that’s why your<br/>is being escaped.So you can do something like this: