How can we include multiple xhtml pages into a summary page. Here all the xhtml pages including same template.
commonTemplate.xhtml
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
<title> SNS </title>
<meta http-equiv="expires" content="0"/>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="sns.css" type="text/css" />
</head>
<h:body>
<div id="header">
<ui:insert name="commonHeader">
<ui:include src="header.xhtml" />
</ui:insert>
</div>
<div id="content">
<ui:insert name="commonBodyContent">
Common Body Content.
</ui:insert>
</div>
<div id="footer">
<ui:insert name="commonFooter">
<ui:include src="footer.xhtml" />
</ui:insert>
</div>
</h:body>
</html>
updatePersonalDetails.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
template="commonTemplate.xhtml">
<ui:define name="commonBodyContent">
.........;
..........;
</ui:define>
</ui:composition>
updatedAddress.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
template="commonTemplate.xhtml">
<ui:define name="commonBodyContent">
.........;
..........;
</ui:define>
</ui:composition>
selectPreferences.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
template="commonTemplate.xhtml">
<ui:define name="commonBodyContent">
.........;
..........;
</ui:define>
</ui:composition>
summary.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:include src="updatePersonalDetails.xhtml" />
<ui:include src="updatedAddress.xhtml" />
<ui:include src="selectPreferences.xhtml" />
</ui:composition>
Whatever the data i have in all xhtml pages, supposed to display exactly same in summary page. But including this causes multiple <html>
documents to render on page.
How can we solve this ?
updatedAddress.xhtml
,selectPreferences.xhtml
etc had moreui:define
:s, in addition tocommonBodyContent
? Say, for example, asecTitle
field. Is there a way to define it inupdatedAddress-content.xhtml
etc and use it in bothupdatedAddress.xhtml
andsummary.xhtml
? – Johanna