I have done a basic JSF app, using facelets templates. My template is as follows:
You can reload content by ajax, but URL will stay the same. If you can afford that, update the code as follows:
In template.xhtml
, replace
<div id="content">
by
<h:panelGroup id="content" layout="block">
And in somepage.xhtml
, replace
<p:commandButton value="Create entry" action="create" />
by
<p:commandButton value="Create entry" action="create" update=":content" />
Finally get rid of the <redirect />
(actually, prefer to get rid of all navigation cases since they make the faces-config.xml
file bloated). A redirect can by the way also be specified in the outcome as in action="create?faces-redirect=true"
.
This does only not update the <title>
. You could however do that with a simple JavaScript line.