membersound
membersound

Reputation: 86747

Temporary variable without backing bean?

I'm trying to make a temp var in a JSF page. I want to use it to store a i18n key that is needed to be passed further in some of the ongoing expressions.

But how can I make a temp var? This does not work:

<c:set var="myVar" value="10" scope="page"/>
<h:outputText value="#{myVar}" />

Just is empty. Nothing is printed from the outputText.

How can I do? ty

Upvotes: 1

Views: 1104

Answers (1)

Daniel
Daniel

Reputation: 37061

use <ui:param instead

<ui:param name="myVar" value="10"></ui:param>
<h:outputText value="#{myVar}" />

Upvotes: 1

Related Questions