Junaid S.
Junaid S.

Reputation: 2642

Define a property in Facelets page

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?

Upvotes: 0

Views: 140

Answers (1)

kolossus
kolossus

Reputation: 20691

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.

Upvotes: 2

Related Questions