I have done a basic JSF app, using facelets templates. My template is as follows:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<!-- Links to CSS stylesheets... -->
<title><ui:insert name="title" /> - FManager</title>
</h:head>
<h:body>
<div id="wrapper">
<div id="header"> <b>FManager</b> Application </div>
<div id="content">
<p:growl id="growl" />
<ui:insert name="content">
Sample content.
</ui:insert>
</div>
</div>
<div id="footer">Made using JSF and Primefaces</div>
</h:body>
</html>
And then I have a Main Page (shown below) that navigates to a Second Page. Both pages use the template above.
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.prime.com.tr/ui"
template="./template.xhtml">
<ui:define name="title">Main page</ui:define>
<ui:define name="content">
<h2>Welcome to the <b>FManager</b> application</h2>
<h:form>
<p>Click the button below to create the first entry!</p>
<p:commandButton value="Create entry" action="create" />
</h:form>
</ui:define>
</ui:composition>
If I use <redirect/> in faces-config.xml, it navigates, but the full page is reloaded. My question is:
Is there a way to navigate from a page to another updating ONLY the <ui:insert> sections of the template? (While leaving the rest of the page intact)
Thanks!