【问题标题】:How to refresh the page at a specific interval如何以特定间隔刷新页面
【发布时间】:2014-03-11 22:17:14
【问题描述】:

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

#{seesion.maxInactiveInterval – 60}

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

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

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

谢谢

【问题讨论】:

标签: jsf-2 primefaces


【解决方案1】:

@安格斯

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

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

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

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

希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-22
    • 2017-03-01
    • 2016-03-27
    • 2012-04-16
    • 1970-01-01
    • 2012-08-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多