3 Replies Latest reply on Jun 19, 2007 9:43 AM by Pasquale Renna

    Problem using <jsp:include>

    Pasquale Renna Newbie

      Hi! In my application, the main JSP page contains a tabPanel (with switchType set on 'ajax') and tabs code is contained in other files (tab1.jsp, tab2.jsp and so on).

      I'm using <jsp:include> to include the tabs code into the main JSP page, but in this case AJAX calls for tab-switching are never performed, while if I replace the <jsp:include> instruction with the real code contained in tabX.jsp the application works well.

      Is this a known problem, or am I doing something wrong? Using Facelets for a 'modular' approach like mine could be a good solution? Thanks in advance.

        • 1. Re: Problem using <jsp:include>
          Pasquale Renna Newbie

          Oops, I forgot to mention that I'm using Richfaces 3.0.1 and A4j 1.1.1 under Websphere Process Server 6.0

          • 2. Re: Problem using <jsp:include>
            Ilya Shaikovsky Master

            Check please a4j:log for some messages. And also check for validation conversion problems on the same form with tabPanel.

            And paste your sources if this will not help.

            • 3. Re: Problem using <jsp:include>
              Pasquale Renna Newbie

              Looking at the log after a failed tab-switch I see no errors occurring:

              debug[15:31:07,325]: Reqest state : 1
              debug[15:31:07,325]: QueryString: AJAXREQUEST=_viewRoot&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id20=DATA&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id24=FORMA%20GIURIDICA&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3AboxStato=&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id35=CF%20P.IVA&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id37=INDIRIZZO&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id41=COMUNE&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id43=PROVINCIA&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id45=STATO%20RESIDENZA&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id49=DESCRIZIONE%20ATTIVITA&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3AboxAttivita=&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3AboxRami=&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id61=CODICE%20CERI&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id65=PRIMO%20AFFIDAMENTO&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm%3A_id69=ULTIMA%20ANOMALIA&compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm=compilazioneFascicoloForm%3AquadroAnagraficoSubView%3AquadroAnagraficoForm&compilazioneFascicoloForm%3A_id96=compilazioneFascicoloForm%3A_id96&
              debug[15:31:07,325]: Reqest state : 1
              debug[15:31:07,356]: Reqest state : 2
              debug[15:31:07,356]: Reqest state : 3
              debug[15:31:07,356]: Reqest state : 4
              debug[15:31:07,372]: Reqest end with state 4
              debug[15:31:07,372]: Response with content-type: text/xml;charset=UTF-8
              debug[15:31:07,372]: Full response content: <?xml version="1.0"?>
              ...
              debug[15:31:07,388]: Header Ajax-Update-Ids not found, search in <meta>
              debug[15:31:07,388]: search for elements by name 'meta' in element #document
              debug[15:31:07,388]: selectNodes found 7
              debug[15:31:07,388]: Find <meta name='null' content='text/html; charset=ISO-8859-1'>
              debug[15:31:07,403]: Find <meta name='GENERATOR' content='Rational Software Architect'>
              debug[15:31:07,403]: Find <meta name='null' content='text/html; charset=ISO-8859-1'>
              debug[15:31:07,403]: Find <meta name='GENERATOR' content='IBM Software Development Platform'>
              debug[15:31:07,419]: Find <meta name='null' content='text/css'>
              debug[15:31:07,419]: Find <meta name='Ajax-Update-Ids' content=''>
              warn[15:31:07,419]: No information in response about elements to replace
              debug[15:31:07,419]: call selectSingleNode for id= ajax-update-ids
              debug[15:31:07,435]: Hidden JSF state fields:
              debug[15:31:07,435]: Namespace for hidden view-state input fields is undefined
              debug[15:31:07,435]: search for elements by name 'input' in element span
              debug[15:31:07,450]: selectNodes found 1
              debug[15:31:07,450]: Replace value for inputs: 15 by new values: 1
              debug[15:31:07,450]: Input in response: jsf_sequence
              debug[15:31:07,450]: search for elements by name 'INPUT' in element span
              debug[15:31:07,466]: selectNodes found 0
              debug[15:31:07,466]: Replace value for inputs: 15 by new values: 0
              debug[15:31:07,466]: call selectSingleNode for id= _A4J.AJAX.focus
              debug[15:31:07,466]: No focus information in response
              


              Here you can find my (cut-down) code. First of all, the caller page:

              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
              <%-- jsf:pagecode language="java" location="/src/pagecode/CompilazioneFascicolo.java" --%><%-- /jsf:pagecode --%>
              <%@page language="java" contentType="text/html; charset=ISO-8859-1"
               pageEncoding="ISO-8859-1"%>
              <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
              <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
              <%@taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
              <%@taglib prefix="a4j" uri="https://ajax4jsf.dev.java.net/ajax"%>
              <%@taglib uri="http://www.ibm.com/jsf/html_extended" prefix="hx"%>
              
              <html>
              <head>
              <title>Compilazione Fascicolo</title>
              <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
              <meta name="GENERATOR" content="Rational Software Architect">
              <link rel="stylesheet" type="text/css" href="theme/stylesheet.css"
               title="Style">
              <link rel="stylesheet" type="text/css" href="theme/tabpanel.css"
               title="Style">
              <link rel="stylesheet" type="text/css" href="theme/styles.css"
               title="Style">
              </head>
              
              
              <script type="text/javascript">
              function conferma(operazione){
              ...
              }
              </script>
              <f:view>
               <body>
              
              <a4j:log />
              
               <h:form id="compilazioneFascicoloForm" styleClass="form">
              
               <h:panelGrid columns="14" styleClass="Testata" width="100%">
              
               <h:outputText value="NDG" styleClass="Testata_th"/>
               <h:outputText value="#{userData.ndgCorrente}" styleClass="Testata_td"/>
              
               <h:outputText value="Nominativo" styleClass="Testata_th"/>
               <h:outputText value="#{userData.nominativoCorrente}" styleClass="Testata_td"/>
              
               <h:outputText value="Fascicolo" styleClass="Testata_th"/>
               <h:outputText value="#{userData.numeroFascicoloCorrente}" styleClass="Testata_td"/>
              
               <h:outputText value="Classificazione" styleClass="Testata_th"/>
               <h:outputText value="#{userData.codiceClassificazioneCorrente}" styleClass="Testata_td"/>
              
               <h:outputText value="CAB" styleClass="Testata_th"/>
               <h:outputText value="#{userData.CABCorrente}" styleClass="Testata_td"/>
              
               <h:outputText value="Descrizione Filiale" styleClass="Testata_th"/>
               <h:outputText value="#{userData.filialeCorrente}" styleClass="Testata_td"/>
              
               <h:commandButton
               value="Aggiorna Situazione"
               styleClass="commandExButton"
               onclick="conferma('l´aggiornamento dei dati\?')"/>
              
               <h:commandButton
               action="#{pc_CompilazioneFascicolo.inoltra}"
               value="Inoltra Fascicolo"
               styleClass="commandExButton"
               onclick="conferma('l´inoltro della richiesta in delibera\?')"
               disabled="true"
               />
               </h:panelGrid>
              
              
              
              
              <rich:tabPanel switchType="ajax" styleClass="tabbedPanel" id="mainTab"
              selectedTab="tabQuadri">
              
               <!-- TAB PANEL VERTICALE-->
               <!-- QUADRI -->
              
               <rich:tab label="Quadri" name="tabQuadri">
              
               <jsp:include page="quadri/QuadroAnagrafico.jsp"/>
              
               </rich:tab>
              
              
              
               <rich:tab label="Prenotazioni" name="tabPrenotazioni">
               <h:outputText value="prenotazioni"></h:outputText>
               </rich:tab>
              
               <rich:tab label="Valutazioni" name="tabValutazioni">
               <h:outputText value="valutzioni"></h:outputText>
               </rich:tab>
              </rich:tabPanel>
              
              
               </h:form>
              
               </body>
              </f:view>
              </html>
              


              And now the callee:

              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
              <%-- jsf:pagecode language="java" location="/JavaSource/pagecode/quadri/QuadroAnagrafico_jspinclude.java" --%><%-- /jsf:pagecode --%>
              <HTML>
              <HEAD>
              
              <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
              <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
              <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
              
              <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
               pageEncoding="ISO-8859-1"%>
              <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
              <META name="GENERATOR" content="IBM Software Development Platform">
              <META http-equiv="Content-Style-Type" content="text/css">
              <LINK href="../theme/Master.css" rel="stylesheet"
               type="text/css">
              <link rel="stylesheet" type="text/css" href="../theme/stylesheet.css"
               title="Style">
              
              <script type="text/javascript" src="script/script.js"></script>
              
              <TITLE>QuadroAnagrafico.jsp</TITLE>
              
              </HEAD>
              <f:subview id="quadroAnagraficoSubView">
              <BODY>
              
              <h:form id="quadroAnagraficoForm" styleClass="form">
              
              
              
               <rich:tabPanel switchType="ajax" styleClass="tabbedPanel" id="quadroAnagraficoPanel">
              
               <!-- TAB QUADRO ANAGRAFICO -->
              
               <rich:tab label="Quadro Anagrafico">
              
               (...)
               </rich:tab>
              
               <!-- TAB QUADRO ANAGRAFICO RAPPORTI -->
              
               <rich:tab label="Quadro Anagrafico Rapporti">
               (...)
               </rich:tab>
              
               </rich:tabPanel>
              
              </h:form>
              
              
              
              </BODY>
              </f:subview>
              </HTML>