Tuesday, 20 August 2013

Page not redirect after session expire

Page not redirect after session expire

From the previous forums and information from internet I found out that
the only logical solution to be redirected to login.xhtml or login page
when the session expires is using OmniFaces.
After using omnifaces, I am able to be directed login.xhtml when session
expires. Unfortunately, when ajax=true at primefaces I am not able to
directed to login.xhtml when session expires. I think the problem comes
with primefaces. Because, when I use pure Jsf such like h:commandButton
and when ajax=true, I can be directed to login.xhtml when session expires.
But it does not work when I use primefaces when ajax=true. You can
understand what I meant more clear below :
<!-- It can be directed to login.xhtm after session expire -->
<h:commandButton value="throw SQL exception on ajax request"
action="#{kdsHome.openCandidateAtmSelectPanelListener}">
<f:ajax execute="@form" render="@form" />
</h:commandButton>
<!-- It can't be directed to login -->
<p:commandButton value="throw SQL exception on ajax request"
action="#{kdsHome.openCandidateAtmSelectPanelListener}"
update="@form">
</p:commandButton>

No comments:

Post a Comment