Define a property in Facelets page

橙三吉。 提交于 2019-12-12 03:23:06

问题


I know that by using <f:loadBundle> I can load whole property file. But is there any tag in Facelets by which I can define a property in Facelets file and can use in Facelets page.

I know this can also be done by controller layer (like getSomeProperty()) but I don't want to do this. I am just looking for a tag that do this.

In other words we can do this in XML like this

<properties>
  <propertyName>propertyValue</propertyName>
<proprties>

So in Facelets how can I do this?


回答1:


Just define a vanilla page-scoped variable using either JSTL. Using JSTL's <c:set/>:

<c:set var="propertyName" value="propertyValue"/>

You could then use #{propertyName} anywhere within your page.



来源:https://stackoverflow.com/questions/27981258/define-a-property-in-facelets-page

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