How to enable Facelet of a different application context

How can I enable Facelet from a different application context? I am creating a Content Manager application where this application has XHTML that contains a menu bar, each submenu has a URL of the corresponding application to launch, and I need to include in this page the application that the user selects.

Content Manager application index page, find in http://localhost:8080/JSFApplication1/index.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:t="http://myfaces.apache.org/tomahawk"
    xmlns:fn="http://java.sun.com/jsp/jstl/functions"
    xmlns:p="http://primefaces.org/ui">

<ui:composition template="./template.xhtml">

    <ui:define name="content">
        <h:body>
            <f:facet name="last">
                <h:outputStylesheet library="css" name="theme.css" />
            </f:facet>
            <h:form id="form1">
                <p:messages id="messages" showSummary="false" showDetail="true"
                    autoUpdate="true" closable="true" />
                <p:dialog id="errorUsuario" header="Error Usuario" modal="true"
                    minimizable="false" maximizable="false" closeOnEscape="false"
                    closable="false"
                    visible="#{ContentManagerBackingBean.verPopupErrorUsuario}"
                    height="100">
                    <h:outputText value="#{ContentManagerBackingBean.mensajePopUp}" />
                </p:dialog>

                <p:menubar model="#{ContentManagerBackingBean.menubarModel}"/>


                <ui:include src="../../JSFAplicaionNueva/index.xhtml" /> 

            </h:form>


        </h:body>
    </ui:define>

</ui:composition>
</html>

      

another app page, find http://localhost:8080/JSFApplication2/index.xhtml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:t="http://myfaces.apache.org/tomahawk"
        xmlns:fn="http://java.sun.com/jsp/jstl/functions"
        xmlns:p="http://primefaces.org/ui">

    <ui:composition template="./template.xhtml">

        <ui:define name="content">
            <h:body>
                THIS IS THE CONTNET OF THE OTHER APPLICATION
            </h:body>
        </ui:define>

    </ui:composition>
    </html>

      

include

dosen't works because it only accepts pages that are contained in one directory and I need access to pages that are contained in another project on the save server.

I know I can use an iframe, but I need a different solution.

+3


source to share





All Articles