I have this code in JSF:
<ui:include rendered="#{paginaMB.pagina eq 'login'}" id="paginaSistema" src="/login.xhtml" />
<ui:include rendered="#{paginaMB.pagina eq 'noticias'}" id="paginaSistema" src="/noticias.xhtml" />
I don't know why using "rendered" both pages are displayed.
If I use this code:
<ui:include id="paginaSistema" src="#{paginaMB.pagina}.xhtml" />
the problem was solved but I have a button inside login.xhtml that uses managed bean and the managed bean is not found, no action is taken when I click on it.
How can I solve this dynamic include?