[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:
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&size=S&use_flash=YES&use_transparent=YES&lang=en"
type=""></script>
</div>
</div>
</div>
</body>
</html> |
et ensuite
/epss/login.xhtml
Code:
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:
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:
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. :ccool: