EL variable in JSF ResourceBundle

主宰稳场 提交于 2019-12-05 11:27:13

JSF resourcebundles does by default not resolve EL. It however by default supports MessageFormat API in combination with <h:outputFormat> and <f:param>.

some.text = {0} more

with

<h:outputFormat value="#{i18n['some.text']}">
    <f:param value="#{someBean.stepsLeft}" />
</h:outputFormat>

You can even explicitly make it a number type so that e.g. 1000 will be displayed as 1,000 or 1.000 depending on the view locale.

some.text = {0,number} more

For more formatting options see thus the MessageFormat API documentation.

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