IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JSF Java Discussion :

[Facelets] Inclusion imbriquée


Sujet :

JSF Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre émérite

    Homme Profil pro
    Senior Développeur JEE
    Inscrit en
    Avril 2002
    Messages
    795
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : Belgique

    Informations professionnelles :
    Activité : Senior Développeur JEE
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2002
    Messages : 795
    Par défaut [Facelets] Inclusion imbriquée
    Bonjour,

    voici mon problème.

    J'ai la structure suivante dans ma webapp

    -webapp (rep)

    |-login.xhtml (page)
    |-epss (rep)
    |-login.xhtml (page)
    |-template.xhtml (page)
    |-psp (rep)
    |-login.xhtml (page)
    |-template.xhtml (page)

    login.xhtml dans le répertoire root contient toute la logique d'affichage des pages.

    Tandis que les pages à l'intérieur des sous répertoires ne s'occupent que de la redirection vers les pages dans le root directory.

    Est-il possible d'avoir une inclusion imbriquée.

    Voici ce que j'avais au début

    /epss/template.xhtml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    <?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" xml:lang="en" lang="en"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j">
        <head>
            <!--
            originating server:<%=
               java.net.InetAddress.getLocalHost().toString()
            %>-->
     
            <meta http-equiv="Expires" content="Tue, 1 Jun 1990 00:40:00 GMT"/>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <meta http-equiv="Pragma" content="no-cache"/>
            <meta http-equiv="Cache-Control" content="no-cache"/>
            <link href="css/template.css" rel="stylesheet" type="text/css"/>
            <link href="css/general.css" rel="stylesheet" type="text/css"/>
            <link href="css/fp7.css" rel="stylesheet" type="text/css"/>
            <script type="text/javascript" src="functions.js"></script>
     
            <title/>
        </head>
        <body>
            <a name="top" id="top"/>
     
            <div id="container">
     
                <div id="titlebanner" title="Electronic Proposal Submission Service (EPSS)">
     
                    <div id="title">
                        <div class="hide"><h1>Electronic Proposal Submission Service (EPSS)</h1></div>
                    </div>
                </div>
     
                <div id="banner">
                    <div id="bkgbanner1"></div>
                    <div id="bkgbanner2"></div>
                    <div id="bkgbanner3"></div>
                    <div id="bkgbanner4" title="FP7"></div>
     
                </div>
     
                <div id="topmenu"></div>
     
                <div id="path">
                    <p><acronym title="Electronic Proposal Submission Service">EPSS</acronym></p>
                </div>
     
                <div id="maincontent">
                    <!--Content starts here-->
     
                    <div id="content">
                        <br clear="all"/>
                        <br clear="all"/>
                        <ui:insert name="epssContent"/>
                    </div>
                    <!--Content ends here-->
                </div>
     
                <div id="footer">
                    <div id="footertext"><a href="#top">Top</a> | <a href="helpdesk.xhtml">EPSS Help Desk</a> | <a
                            href="EPSS-Userguide.pdf">EPSS User Guide</a> | <a
                            href="EPSS_SSPS_APPLICANTS_v3.pdf">Privacy statement</a> | <a
                            href="epss_faq.xhtml">EPSS FAQ</a> |
                        <a href="http://cordis.europa.eu/guidance/services_en.html">CORDIS Support</a></div>
                    <div align="right">
                        <script src="https://seal.verisign.com/getseal?host_name=www.epss-fp7.org&amp;size=S&amp;use_flash=YES&amp;use_transparent=YES&amp;lang=en"
                                type=""></script>
                    </div>
                </div>
     
            </div>
     
        </body>
    </html>
    et ensuite

    /epss/login.xhtml

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    <!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" xml:lang="en" lang="en"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j">
        <head>
            <title>Login page</title>
        </head>
        <body>
            <ui:composition template="template.xhtml">
                <ui:define name="epssContent">
                    <h:form>
                        <h:outputText>Username:</h:outputText>
                        <h:inputText value=""/>
                        <h:outputText>Password:</h:outputText>
                        <h:inputText value=""/>
                        <h:commandButton value="Submit"/>
                        <rich:panel>
                            <h:panelGrid columns="2">
                                <h:outputText>Username:</h:outputText>
                                <h:inputText value=""/>
                                <h:outputText>Password:</h:outputText>
                                <h:inputText value=""/>
                                <h:commandButton value="Submit"/>
                            </h:panelGrid>
                        </rich:panel>
                    </h:form>
                </ui:define>
            </ui:composition>
        </body>
    </html>
    jusque là pas de problème

    Maintenant j'aimerais bouger la partie de code <ui:define> qui se trouve dans /epss/login.xhtml vers la page login.xhtml qui se trouve dans le root context.

    Et c'est là que je coince.

    Voici ce que j'ai essayé, mais qui ne fonctionne pas

    /epss/template.xhtml reste tel quel.
    /epss/login.xhtml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <!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" xml:lang="en" lang="en"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j">
        <head>
            <title>Login page</title>
        </head>
        <body>
            <ui:composition template="template.xhtml">
                <ui:insert name="loginContent"> <ui:param name="context" value="epss"/></ui:insert>
            </ui:composition>
        </body>
    </html>
    /login.xhtml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    <?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" xml:lang="en" lang="en"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j">
        <head>
            <title>Login page</title>
        </head>
        <body>
            <ui:composition template="#{context}/login.xhtml">
                <ui:define name="loginContent">
                    <h:form>
                        <h:outputText>Username:</h:outputText>
                        <h:inputText value=""/>
                        <h:outputText>Password:</h:outputText>
                        <h:inputText value=""/>
                        <h:commandButton value="Submit"/>
                        <rich:panel>
                            <h:panelGrid columns="2">
                                <h:outputText>Username:</h:outputText>
                                <h:inputText value=""/>
                                <h:outputText>Password:</h:outputText>
                                <h:inputText value=""/>
                                <h:commandButton value="Submit"/>
                            </h:panelGrid>
                        </rich:panel>
                    </h:form>
                </ui:define>
            </ui:composition></body>
     
    </html>
    le template.xhtml est bien affiché, mais pas le reste.

    Si quelqu'un a une idée elle est la bienvenue.

    Merci d'avance pour votre aide.

  2. #2
    Membre émérite

    Homme Profil pro
    Senior Développeur JEE
    Inscrit en
    Avril 2002
    Messages
    795
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : Belgique

    Informations professionnelles :
    Activité : Senior Développeur JEE
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2002
    Messages : 795
    Par défaut
    Personne ??

    Déjà est-ce possible ce que je demande avec facelets ??

    Merci pour votre aide.

  3. #3
    Membre émérite

    Homme Profil pro
    Senior Développeur JEE
    Inscrit en
    Avril 2002
    Messages
    795
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : Belgique

    Informations professionnelles :
    Activité : Senior Développeur JEE
    Secteur : Finance

    Informations forums :
    Inscription : Avril 2002
    Messages : 795
    Par défaut
    Ok c'est bon j'ai trouvé.

    voici les pages

    /epss/login.xhtml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <!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" xml:lang="en" lang="en"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j">
        <head>
            <title>Login page</title>
        </head>
        <body>
            <ui:composition template="template.xhtml">
                <ui:define name="epssContent"><ui:include src="../login.xhtml"/></ui:define>
            </ui:composition>
        </body>
    </html>
    login.xhtml

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    <?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" xml:lang="en" lang="en"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j">
        <head>
            <title>Login page</title>
        </head>
        <body>
            <ui:composition>
                <h:form>
                        <h:outputText>Username:</h:outputText>
                        <h:inputText value=""/>
                        <h:outputText>Password:</h:outputText>
                        <h:inputText value=""/>
                        <h:commandButton value="Submit"/>
                        <rich:panel>
                            <h:panelGrid columns="2">
                                <h:outputText>Username:</h:outputText>
                                <h:inputText value=""/>
                                <h:outputText>Password:</h:outputText>
                                <h:inputText value=""/>
                                <h:commandButton value="Submit"/>
                            </h:panelGrid>
                        </rich:panel>
                    </h:form>           
            </ui:composition></body>
     
    </html>
    Et c'est beaucoup plus logique ainsi.

    Problème résolu.

    On n'est jamais aussi bien servi que par soi-même.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 7
    Dernier message: 08/04/2010, 15h56
  2. Réponses: 2
    Dernier message: 29/06/2007, 09h37
  3. Problème d'inclusions imbriquées
    Par b4u dans le forum C
    Réponses: 7
    Dernier message: 14/08/2006, 14h11
  4. Requête imbriquée et indexes INTERBASE
    Par vadim dans le forum InterBase
    Réponses: 2
    Dernier message: 06/09/2002, 16h15
  5. Inclusion de fichiers en IDL
    Par babou dans le forum CORBA
    Réponses: 10
    Dernier message: 30/07/2002, 16h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo