How to show a property loaded from properties file in JSF page

帅比萌擦擦* 提交于 2019-12-01 08:33:35

You can (ab)use <f:loadBundle> for this.

<f:loadBundle basename="project" var="project" />
...
<h:outputText value="#{project['cfg.bd.dbname']} />

I said abuse, because the <f:loadBundle> is initially intented to load localized text bundles which allows for internationalization, but as it's under the covers using the same type of properties files, you could as good use it for any arbitrary properties file in the classpath.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!