显示来自 Web 应用程序的系统托盘通知或桌面通知 [英] Show a System Tray notification or Desktop notification from the web application

查看:53
本文介绍了显示来自 Web 应用程序的系统托盘通知或桌面通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用具有登录功能的 J2EE 6.0 在 Java 中创建了一个 Web 应用程序.当用户登录应用程序时,计时器从 59:59(分:秒)开始并持续减少,直到 3:00.还剩 3 分钟时,它会向用户显示一个弹出窗口,要求用户退出延长他们的时间/会话,再次回到 59:59.

I have created a web application in Java using J2EE 6.0 that has login functionality. As the user logs in into the application, a timer start at 59:59 (minutes:seconds) and keeps on decreasing until it comes to 3:00. When 3 minutes are left, it displays a popup to the user asking to logout or extend their time/session again back to 59:59.

我的问题是用户是否正在做一些其他工作,比如在 Outlook 上或在新窗口/浏览器(Firefox 等)中通过互联网浏览其他内容.我如何通知用户他的会话/时间即将到期.此应用程序旨在仅在 Microsoft Windows Internet Explorer 上运行.

My question is if user is doing some other work say on outlook or surfing some other thing over the internet in a new window/browser(Firefox,etc.). How can I notify the user that his session/time is going to expire. This application is intended to run only on Microsoft Windows Internet Explorer.

我找到了这些用于显示桌面通知的链接,但不幸的是我的应用程序特定于仅在 Internet Explorer 上运行

I found these links for displaying desktop notifications but unfortunately my application is specific to run on Internet Explorer only

什么有哪些方法可以显示来自网络应用的桌面通知?

Stack Overflow 桌面通知如何工作?

所以我不能使用桌面通知.

我想我会创建一个 swing 应用程序,以在 Windows 系统托盘中显示通知弹出窗口,提示您的会话即将到期".但我很困惑它将如何在客户端机器上运行.我听说过一种叫做 Java Web StartAjaxSwing 等的东西.使用 Java Web Start 软件,用户可以通过单击网页中的链接来启动 Java 应用程序.它需要客户端系统中的 JRE.Java Web Start 将要求用户下载 Java 插件,该插件将下载令人讨厌的 JRE(如果在客户端系统中找不到).

I thought I would create a swing application to display the notification popup in the Windows System Tray saying 'Your session is going to expire'. But I am stucked how will it run on the client machine. I have heard of something called Java Web Start, AjaxSwing, etc. With Java Web Start software, users can launch a Java application by clicking a link in a web page. It requires JRE in the client system. Java Web Start will ask the user to download the Java plugin which will download a JRE(if not found in the client's system) which is annoying.

AjaxSwing 会将 Swing 应用程序转换为 HTML、Javascript 和 CSS,因此我不确定浏览器如何在系统托盘中显示弹出窗口.我认为这将继续坚持浏览器.

AjaxSwing will convert the Swing app to HTML, Javascript and CSS so I am not sure how it will come out of a browser to show up a popup in System Tray. I think that will remain stick to the browser.

我搜索了使选项卡闪烁的选项,但它没有使窗口任务栏中的选项卡闪烁.

I searched for blinking the tab option but it is not blinking the tab in the taskbar of the windows.

我在某处阅读Growl for Windows,但我不确定它是否对我有帮助.也请告诉我.请建议我如何通知用户他的会话将要到期.我已经知道我可以通过电子邮件通知.请帮助我提供一个创新的想法和解决方案以进一步追求.

I read somewhere Growl for Windows but I am not sure whether it will be helpful for me or not. Please tell that also. Please suggest me how can I notify the user that his session is going to expire. I already know I can notify through the email. Please help me with an innovative idea and solution to pursue further.

推荐答案

我遇到了同样的问题并使用了 jquery通知插件 作为一种解决方法,您还可以在插件回调中使用onShow"来播放声音或确保通知用户的任何内容

I faced the same problem and used jquery notification plugin as a workaround you can also use "onShow" in the plugin callback to play a sound or whatever to make sure that the user is notified

这篇关于显示来自 Web 应用程序的系统托盘通知或桌面通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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