我有一个接缝组件,我在其中使用标准接缝注释放置消息:
@In
private StatusMessages statusMessages;
public void myMethod()
{
statusMessages.add("Welcome, #{user.getName()}, after confirmation you will be able to log in.");
}
而不是在 xthml 页面中显示此消息:
<h:messages id="mensagensHome" globalOnly="true" styleClass="message"
errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"
rendered="#{showGlobalMessages != 'false'}" />
这工作得很好,但我有一个要求,名字应该是粗体。比我已经尝试在我的消息中放置标准 html 标记,例如:
statusMessages.add("Welcome, <b> #{user.getName()} </b>, after confirmation you will be able to log in.");
但它会在页面上显示标签并且不会将名称变为粗体。
我也尝试过使用 unicode 转义字符来呈现 html 标签,但同样没有成功。
是否可以使用代码中的标准 html 标签来格式化 Seam 中的消息?
提前发送。