ATEF CHAREF
ATEF CHAREF

Reputation: 397

Struts 2 escape html doesn't work?

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:

Upvotes: 1

Views: 4281

Answers (1)

Roman C
Roman C

Reputation: 1

Try the code in the action

public String getValue(){
  return StringEscapeUtils.unescapeHtml4(this.value);
}

then use with

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

Upvotes: 1

Related Questions