在JSF资源包字符串中包含HTML - 可能吗? [英] Including HTML in JSF resource bundle string - possible?

查看:115
本文介绍了在JSF资源包字符串中包含HTML - 可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的JSF页面的 h:outputText 标签中使用资源包属性文件中定义的属性。是否可以在属性文件字符串中包含HTML,以便我可以在页面上显示图像?我无法直接在页面中执行此操作的原因是,这必须是操作团队的可配置选项。 解决方案

p>是的,只需在< h:outputText> 上设置 escape =false 't be HTML-escaped。

 < h:outputText value =#{bundle ['some.key']} escape =false/> 


I am using a property defined in a resource bundle properties file in an h:outputText tag in my JSF page. Is it possible to include HTML in the property file string, so that I can display an image on the page? The reason that I can't do this directly in the page is that this has to be a configurable option for the operations team.

解决方案

Yes, just set escape="false" on the <h:outputText> so that the value won't be HTML-escaped.

<h:outputText value="#{bundle['some.key']}" escape="false" />

这篇关于在JSF资源包字符串中包含HTML - 可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆