You can use ui:param
In the following ways:
or
or
and use later on like this
Another option would be using in the following way
But note that 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?