Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

struts2 send html text back in actionerror or action message

Tags:

java

html

struts2

In my web application I want to send some text back in the

addActionError("User not logged in. <a href=\"logon\">Click Here</a> to log in");

The problem is the html text appears as normal text and does not appear as a link to click on.

like image 289
sethu Avatar asked Dec 22 '22 06:12

sethu


1 Answers

Set the escape="false" attribute on the <s:actionerror> tag; it defaults to true:

<s:actionerror escape="false"/>

See the <s:actionerror> docs for more details. Roughly:

escape default=false required=false type=Boolean ==> Whether to escape HTML
like image 79
Dave Newton Avatar answered Jan 16 '23 15:01

Dave Newton