0 Replies Latest reply on Dec 7, 2006 12:11 PM by alban_coul

    problem including a jsp file into a jsf

    alban_coul Newbie

      Hello,
      Using jboss 4.0.4 with SEAM.
      I have a problem when I use <jsp:include> into my jsf, it seams that SEAM instanciates as much databean as included page, so my conversation gets crazy!
      I need to include them because I use a tabpane.
      I am just wondering what to do, to be able to include jsp files into jsf page.

      Here is the code of the main page :

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <%@ taglib uri="http://fmk.xxxx.fr/faces/cpage.tld" prefix="c"%>
      <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
      
      <script language="JavaScript"
       src="<%=request.getContextPath()%>/js/navbox.js"></script>
      <f:view>
       <c:page>
       <h:form id="priseEnChargeExterneMinimaleForm">
       <c:document userContext="#{UserBean.userContext}">
       <f:facet name="htmlHead">
       <h:panelGroup>
       <f:loadBundle
       basename="fr.cpage.patient.priseencharge.web.messages" var="msg" />
       </h:panelGroup>
       </f:facet>
       <f:facet name="topBody">
       <h:panelGrid>
       <c:commandButton value="#{msg.enregistrer}"
       action="#{priseEnChargeExterneMinimale.enregistrer}" />
       </h:panelGrid>
       </f:facet>
       <t:stylesheet path="/css/prise-en-charge.css" />
       <t:stylesheet path="/css/menu-carte.css" />
       <h:panelGrid columns="1" columnClasses="paddingLienPopup">
       <f:subview id="menuCarte">
       <jsp:include flush="true" page="../popup/menu-carte.jsp" />
       </f:subview>
       </h:panelGrid>
       <h:panelGrid columns="7" styleClass="valignCenter">
       <h:outputLabel for="nom_usage_requis"
       value="#{msg.pecu_libelle_nom_usage}" />
       <h:inputText size="25" id="nom_usage_requis"
       value="#{identiteDatabean.nomUsage}" />
       <h:outputLabel for="prenomUsage" value="#{msg.pecu_libelle_prenom}" />
       <h:inputText size="25" id="prenomUsage"
       value="#{identiteDatabean.prenomUsage}" />
       <h:outputLabel for="dossier"
       value="#{msg.pecu_libelle_numero_dossier}" />
       <h:panelGrid columns="3" id="dossier" cellpadding="0"
       cellspacing="0">
       <h:outputText value="(#{dossierDatabean.etat})" />
       <h:outputText
       binding="#{priseEnChargeExterneMinimale.numeroDossierOutput}"
       value="#{dossierDatabean.numeroHospitalisation}" />
       <h:inputText size="10"
       binding="#{priseEnChargeExterneMinimale.numeroDossierInput}"
       value="#{dossierDatabean.numeroHospitalisation}" rendered="false" />
       </h:panelGrid>
       </h:panelGrid>
       <c:graphicImageSpacer />
       <t:panelTabbedPane binding="#{priseEnChargeExterneMinimale.onglets}">
       <t:panelTab label="#{msg.pecem_label_onglet_identite}">
       <f:subview id="ongletIdentite">
       <jsp:include flush="true" page="pecem-identite-onglet.jsp" />
       </f:subview>
       </t:panelTab>
       <t:panelTab label="#{msg.pecem_label_onglet_personne_en_relation}">
       <f:subview id="ongletPersonneEnRelation">
       <jsp:include flush="true"
       page="pecem-personne-en-relation-onglet.jsp" />
       </f:subview>
       </t:panelTab>
       <t:panelTab label="#{msg.pecem_label_onglet_dossier_mouvement}">
       <f:subview id="ongletDossierMouvement">
       <jsp:include flush="true"
       page="pecem-dossier-mouvement-onglet.jsp" />
       </f:subview>
       </t:panelTab>
       </t:panelTabbedPane>
       </c:document>
       </h:form>
       </c:page>
      </f:view>
      


      And here the code of an included page :
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
      <%@ taglib uri="http://fmk.xxxx.fr/faces/cpage.tld" prefix="c"%>
      
      
      <h:panelGrid width="920">
       <h:panelGrid width="460">
       <h:outputLabel for="nisAQS" value="#{msg.ra_libelle_aqs}" />
       <h:panelGrid columnClasses=", paddingCodeLibelle" cellpadding="0"
       cellspacing="0">
       <h:inputText id="nisAQS" size="5"
       value="#{identiteDatabean.aqsHebergeur }" />
       <h:inputText id="hebergeurAQS" size="16"
       value="#{identiteDatabean.aqsNis }" />
       </h:panelGrid>
       <h:outputLabel for="nom_naissance_requis"
       value="#{msg.pecu_libelle_nom_naissance}" />
       <h:inputText size="25" id="nom_naissance_requis"
       value="#{identiteDatabean.nomFamille}">
       </h:inputText>
       <h:outputLabel for="nomMarital"
       value="#{msg.pecu_libelle_nom_marital}" />
       <h:inputText size="25" id="nomMarital"
       binding="#{priseEnChargeExterneMinimale.nomMarital}" />
       <h:outputLabel for="sexe" value="#{msg.ra_libelle_sexe}" />
       <h:selectOneListbox id="sexe" onchange="submit()"
       valueChangeListener="#{priseEnChargeExterneMinimale.sexeChanged}"
       value="#{identiteDatabean.sexe}" size="1">
       <f:selectItems value="#{identiteDatabean.sexes}" />
       </h:selectOneListbox>
       <h:outputLabel for="date_naissance_requise"
       value="#{msg.pecu_libelle_ne_le}" />
       <h:inputText id="date_naissance_requise" size="10"
       value="#{identiteDatabean.dateNaissance}">
       <f:convertDateTime timeZone="Europe/Paris" pattern="dd/MM/yyyy"
       locale="FR_fr" />
       </h:inputText>
       <h:outputLabel for="situationFamille"
       value="#{msg.pecu_libelle_situation_de_famille}" />
       <h:selectOneListbox id="situationFamille"
       value="#{identiteDatabean.situationFamilleSelectionne}" size="1">
       <f:selectItems value="#{identiteDatabean.situationsFamille}" />
       </h:selectOneListbox>
       <h:outputLabel value="#{msg.pecu_libelle_validite}" />
       <h:selectBooleanCheckbox id="validite"
       value="#{identiteDatabean.validePatient}" />
       </h:panelGrid>
       <h:panelGrid width="460">
       <h:outputLabel for="nip" value="#{msg.pecu_libelle_nip}" />
       <h:outputText id="nip" value="#{identiteDatabean.codeNip}" />
       <h:outputLabel for="adresse_premiere_ligne_requise"
       value="#{msg.pecu_libelle_adresse_de_residence}" />
       <h:inputText id="adresse_premiere_ligne_requise" size="33"
       value="#{identiteDatabean.rue}">
       </h:inputText>
       <h:outputLabel />
       <h:inputText id="adresseDeuxiemeLigne" size="33"
       value="#{identiteDatabean.premiereLigne}" />
       <h:outputLabel for="codePostalcommune"
       value="#{msg.pecu_libelle_code_postal_commune}" />
       <h:panelGrid columnClasses=", paddingCodeLibelle"
       id="codePostalcommune" cellpadding="0" cellspacing="0">
       <c:inputCompleteText
       value="#{identiteDatabean.codeDepartementDomicile}" size="5"
       id="code_postal_requis">
       </c:inputCompleteText>
       <c:inputCompleteText
       value="#{identiteDatabean.libelleDepartementDomicile}" size="25"
       id="commune_requise">
       </c:inputCompleteText>
       </h:panelGrid>
       <h:outputLabel for="pays" value="#{msg.pecu_libelle_pays}" />
       <h:panelGrid columnClasses=", paddingCodeLibelle" id="pays"
       cellpadding="0" cellspacing="0">
       <c:inputCompleteText value="#{identiteDatabean.codeIsoPaysDomicile}"
       size="3" id="code_pays_requis">
       </c:inputCompleteText>
       <c:inputCompleteText value="#{identiteDatabean.libellePaysDomicile}"
       size="25" id="pays_requis">
       </c:inputCompleteText>
       </h:panelGrid>
       <h:outputLabel for="modifieeLe"
       value="#{msg.pecu_libelle_adresse_modifiee_le}" />
       <h:outputText id="modifieeLe"
       value="#{identiteDatabean.dateDerniereModificationDomicile}">
       <f:convertDateTime timeZone="Europe/Paris" pattern="dd/MM/yyyy"
       locale="FR_fr" />
       </h:outputText>
       <h:outputLabel for="telephoneDomicile"
       value="#{msg.pecu_libelle_telephone_domicile}" />
       <h:panelGrid columnClasses=" , , paddingLR" columns="3"
       cellpadding="0" cellspacing="0">
       <h:inputText size="10" id="telephoneDomicile"
       value="#{identiteDatabean.telDomicile}" />
       <h:selectBooleanCheckbox id="lrd"
       value="#{identiteDatabean.telDomicileListeRouge}" />
       <c:graphicImageRedPhone />
       </h:panelGrid>
       <h:outputLabel for="telephonePortable"
       value="#{msg.pecu_libelle_portable}" />
       <h:panelGrid columnClasses=" , , paddingLR" cellpadding="0"
       cellspacing="0" columns="3">
       <h:inputText size="10" id="telephonePortable"
       value="#{identiteDatabean.telPortable}" />
       <h:selectBooleanCheckbox id="lrp"
       value="#{identiteDatabean.telPortableListeRouge}" />
       <c:graphicImageRedPhone />
       </h:panelGrid>
       </h:panelGrid>
      </h:panelGrid>


      Any help would be appreciated.
      Thanks.
      Alban