I'm implementing a web application using JSF 2.1.8 and I have a problem with the ui:include tag. I have this code
<h:panelGroup id="panelContenido">
<ui:fragment rendered="#{!empty navigationManagerSystem._Navegable}">
<ui:include src="#{navigationManagerSystem._Navegable._IncludePath}" />
</ui:fragment>
<ui:fragment rendered="#{empty navigationManagerSystem._Navegable}">
<ui:include src="/system/navigation/error.xhtml" />
</ui:fragment>
</h:panelGroup>
The navigationManagerSystem bean is JSF session managed and when this piece of code is firstly rendered, it is supposed to show the include path content. This include works if I do it in a constant like that <ui:include /system/home/index.xhtml" />
but not if I put it in the variable, even I have seen the variable is holding that value before the screen prints. I don't know if it can be related with the bean that holds /system/home/index.xhtml page, which is View Scoped.
Anyway, if I do a page refresh just after page rendering, the xthml is properly included. By the way, I have simplified the page to be included in order to not have any jstl tags, because I know they can cause problems with View Scope.
Any idea about that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…