会话到期后页面不重定向

时间:2013-08-20 13:59:50

标签: java jsf redirect primefaces omnifaces

从以前的论坛和来自互联网的信息我发现,当会话到期时,唯一可以重定向到login.xhtml或登录页面的逻辑解决方案是使用OmniFaces。

使用omnifaces后,我可以在会话到期时指向login.xhtml。不幸的是,当ajax=true处于主要表面时,我无法在会话到期时指向login.xhtml。我认为问题来自于primefaces。因为,当我使用像h:commandButton这样的纯Jsf和ajax=true时,我会在会话到期时被定向到login.xhtml。但是当ajax=true使用primeface时,它不起作用。您可以在下面更清楚地理解我的意思:

<!-- 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>

0 个答案:

没有答案
相关问题