You can use ui:param
In the following ways:
<ui:param name="buttonText" value="#{myBean.MyValue}" />
or
<ui:param name="buttonText" value="someText" />
or
<ui:param name="buttonText" value="someText#{myBean.MyValue}" />
and use later on like this
<h:outputText value="#{buttonText}"/>
Another option would be using <c:set
in the following way
<c:set var="buttonText" value="#{myBean.MyValue}" />
But note that <c:set
is a JSTL tag,
JSTL tags runs during building the view (when the XHTML file is converted to
JSF component tree)
Also you might want to read this JSTL in JSF2 Facelets… makes sense?