如何以特定间隔刷新页面

时间:2014-03-11 22:17:15

标签: jsf-2 primefaces

我想在会话过期前一分钟刷新页面。

#{seesion.maxInactiveInterval – 60}

看起来p:poll是适合此的API,但我该如何设置间隔?

http://www.primefaces.org/showcase-labs/ui/poll.jsf

 <p:poll interval="#{session.maxInactiveInterval - 60}"  update="txt_count" />

由于

1 个答案:

答案 0 :(得分:0)

@Angus

我相信你想在会话到期之前刷新页面。 表示如果用户活动空闲超过60秒,您的会话将过期。

所以是的,你可以使用primefaces p:poll component作为

<p:poll interval="59" update="txt_count" /> 

在属性interval,我们可以定义以秒为单位的时间,在此指定的时间间隔后,我们的页面将被刷新。

希望这有帮助