Struts2 send html text back to actionerror or action message

In my web application, I want to send text back to

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

The problem is that the html text is displayed as plain text and not displayed as a click link.

+4
source share
1 answer

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

 <s:actionerror escape="false"/> 

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

 escape default=false required=false type=Boolean ==> Whether to escape HTML 
+11
source

Source: https://habr.com/ru/post/1380970/


All Articles