我想将用户发送到/login.xhtml
如果他/她在一段时间内闲置。我尝试过 PrimeFaces<p:idlemonitor>
但不知道如何实现这一点。
Use the IdleMonitor http://www.primefaces.org/docs/api/4.0/成分<p:idleMonitor>
<p:idleMonitor timeout="3000">
<p:ajax event="idle" listener="#{idleMonitorBean.processTimeOut()}"/>
</p:idleMonitor>
Note: timeout
in millseconds
然后在您的侦听器方法中只需指定redirect()
path.
@Model
public class IdleMonitorBean {
public void processTimeOut() throws IOException {
FacesContext.getCurrentInstance().getExternalContext().redirect(
"/contextroot/index.xhtml");
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)