当部分刷新不起作用时如何自动刷新页面? [英] How do I refresh page automatically when partial refresh doesn't work?

查看:26
本文介绍了当部分刷新不起作用时如何自动刷新页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果将 xpage 在浏览器中打开几个小时,然后当我回来并尝试单击寻呼机(进行部分刷新)时,它不起作用.那么我怎样才能自动检测到这一点并强制完全刷新呢?有可能吗?

If a leave a xpage open in the browser for a couple of hours, then when I come back and try to click on the pager (which does a partial refresh), it doesn't work. So how can I automatically detect this and force a full refresh? Is it possible at all?

推荐答案

答案取决于您想要完成什么,以及您愿意为此付出什么代价.部分刷新失败的原因是因为用户的 XSP 会话已超时,因此有关特定用户的页面视图的信息已过期,不能只是使其工作".必须发生的事情是您需要设计和实施一种方法来维护和重新加载页面状态,然后必须在新会话中恢复,或者会话首先需要永不过期.第二种方式最简单,第一种方式非常困难.应用程序设置的 XPage 选项卡上有一个设置,允许您控制应用程序的超时.将值设置得更高以允许页面更长时间地保持活动状态.这里有一个权衡,因为会话在内存中的时间越长,需要的内存就越多,这会导致可扩展性降低.或者,您可以在 onError 中构建一些逻辑,它会检测失败的部分刷新,然后执行完全刷新以重新建立会话,但任何会话数据都将丢失.

The answer depends on what you are trying to accomplish, and what you are willing to trade off to do it. The reason the partial refresh fails is because the user's XSP session has timed out, so the information about the particular user's page view has expired, and can not be just "made to work." What has to happen is you'll need to either devise and implement a way to maintain and reload the state of the page, which then has to be restored inside a new session, or the session needs to never expire in the first place. The second way is the easiest, and the first is very difficult. There is a setting on the XPages tab of the application settings that allows you to control the application's timeout. Set the value higher to allow the page to stay active longer. There is a trade off here for as the longer a session is in memory, the more memory that is required, which leads to reduced scalability. Alternatively you can build some some logic into the onError which would detect the failed partial refresh and then perform a full refresh to re-establish the session, but any session data would be lost.

这篇关于当部分刷新不起作用时如何自动刷新页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆