是否有会话超时后触发的事件?

发布于 2025-01-03 16:52:30 字数 458 浏览 1 评论 0原文

为了定义我自己的侦听器,我使用以下属性禁用了默认侦听器:

<property as="xs:boolean" name="oxf.xforms.show-error-dialog"  value="false"/>

我正在使用的 Java 脚本是:

ORBEON.xforms.Events.orbeonLoadedEvent.subscribe(function(eventName, eventData) {
                    var test=eventData.details;
                    alert(test);
                    });

我希望在发生会话超时时执行此脚本?我怎样才能执行这个?

最终,我想要实现的是我想在会话超时后显示我自己的错误消息。

In order to define my own listener, I have disabled the default one using the following property:

<property as="xs:boolean" name="oxf.xforms.show-error-dialog"  value="false"/>

The Java Script I am using is:

ORBEON.xforms.Events.orbeonLoadedEvent.subscribe(function(eventName, eventData) {
                    var test=eventData.details;
                    alert(test);
                    });

I want this script to get executed when a session timeout occurs ? How can I execute this ?

Eventually, what I wanto achieve is that I want to display my own error message after a session timeout..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼睛会笑 2025-01-10 16:52:30

发生会话超时时,不会发生客户端事件。这是严格发生在服务器上的事情。

如果您试图防止会话超时,

如果您尝试检测会话何时过期,并将用户重定向到另一个页面,您可以通过注册自己的 JavaScript 错误处理程序

There is no client-side event happening when a session timeout occurs. This is something that happens strictly on the server.

If you are trying to prevent a session timeout, the session heartbeat feature should go a long way. In a nutshell, as long as users keep a page open, it will ensure that their session doesn't expired on the server.

If you are trying to detect when a session expired, and redirect users to another page, you can do so by registering your own JavaScript error handler.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文