I am trying to build a problem given in a book.
The author mentions:
Sometimes, the JSTL <c:set>
tag can solve issues that the JSF <f:param>
tag can't. Probably, you know that we can pass parameters to the <ui:include>
tag using the <f:param>
tag, as shown in the following code:
<ui:include src="rafa.xhtml">
<f:param name="rafa" value="Rafael Nadal Page"/>,
</ui:include>
Well, this approach triggers an issue! Now, the Rafael Nadal Page value will be available in the included page through EL, #{rafa}
, but will not be available in the constructor of the managed bean of the included page!
It is time for the <c:set>
tag to save the situation; therefore, the code will be changed to the following:
<ui:include src="rafa.xhtml">
<c:set var="rafa" value="Rafael Nadal Page" scope="request"/>,
</ui:include>
When I use <c:set>
, it works perfectly with its availibility as #{rafa}
,
while in case of <f:param>
, it gives me an exception like this:
while the author mentions that the value will be available in the included page through EL,
#{rafa}
. I am not talking about the value in the bean's constructor
, but for the included page. What exactly does he mean?