【问题标题】:struts2 send html text back in actionerror or action messagestruts2 在 actionerror 或 action 消息中发回 html 文本
【发布时间】:2011-12-27 22:22:51
【问题描述】:

在我的网络应用程序中,我想在

中发回一些文本
addActionError("User not logged in. <a href=\"logon\">Click Here</a> to log in");

问题是 html 文本显示为普通文本,而不显示为可单击的链接。

【问题讨论】:

    标签: java html struts2


    【解决方案1】:

    &lt;s:actionerror&gt;标签上设置escape="false"属性;默认为true:

    <s:actionerror escape="false"/>
    

    有关详细信息,请参阅&lt;s:actionerror&gt; docs。大致:

    escape default=false required=false type=Boolean ==> Whether to escape HTML
    

    【讨论】:

      猜你喜欢
      • 2012-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-09
      • 1970-01-01
      • 2013-03-07
      • 2016-08-10
      相关资源
      最近更新 更多