问题
I have a Struts2 problem,
<s:property escape="false" value="value" />
value is got from database, content html tags, Example:
TOTO<br/>Adresse:<br/>
when using Struts2 tag with escape false the result: TOTO<br/>Adress:<br/>
and not the well formatted content, so anyone has an idea how to correct this?
I try escapeHhtml
, escapeXML
, escape
, always same problem...
the result that I want is like:
TOTO
Adress:
回答1:
Try the code in the action
public String getValue(){
return StringEscapeUtils.unescapeHtml4(this.value);
}
then use with
<s:property escapeHtml="false" value="value" />
来源:https://stackoverflow.com/questions/27797431/struts-2-escape-html-doesnt-work