[英]JSF: Line break with language bundle not possible with \n or <br/>
我有一个语言包,如果保存成功,我想抛出一条信息消息。 在方面,我得到这样的消息:
<h:messages infoClass="info" errorClass="error" escape="false" />
在Backing Bean中,我这样写:
fcxt.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, rb.getString("save_success"), null));
“ save_success”的语言模式如下:
Saving successful! <br />You will receive your changes per email and also can have a look at this at your profile.
我也尝试过:
Saving successful! <br />You will receive your changes per email and also can have a look at this at your profile.
有谁知道为什么没有换行符? 我怎么能换行?
h:messages
没有escape
属性,因此您可以尝试使用h:outputText
例如:
<h:outputText value="#{MyBean.errMsg}" escape="false"/>
并尝试
保存成功!
<br/>
您将通过电子邮件收到更改,也可以在您的个人资料中查看。
对于语言模式。 其中<
代表<
和>
代表>
。
另外,您可以检查此代码示例。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.