Java Web Start (JNLP) 相对于 Java Applet 的优势 [英] Java Web Start (JNLP) advantages over Java Applet

查看:21
本文介绍了Java Web Start (JNLP) 相对于 Java Applet 的优势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您认为 Java Web Start 项目相对于 Java Applet 的优缺点是什么?我们试图弄清楚我们应该为我们的新应用程序使用什么类型.我们已经开发了一个桌面应用程序 (JAR),并且我们正在努力使每个安装了 Java 的机器都可以使用,而无需安装它.

有什么想法吗?

解决方案

  1. 小程序/浏览器/JRE 交互问题.如果您不明白我的意思,甚至没有任何暗示(从脱发中得知),那么部署小程序将是一个陡峭的学习曲线.
  2. 浏览器为交易带来了什么?如果答案是 JS 交互性、与现有的基于 HTML 的 Web 应用程序的集成,或者其他一些相关的事情,那就足够了.如果没有,那么问问自己部署应用程序的优势是什么.真的是包裹在浏览器窗口中吗?
  3. JWS Jar 缓存和更新更可靠(如果需要,可以在程序控制下进行).
  4. AppletContext 为小程序提供了一些与环境交互的能力,但 JNLP API 超出了 AC 所能实现的范围(主要是).
  5. 一般可用性.这些对于您的用例来说可能是也可能不是问题.

    1. 一个自由浮动的 JWS 部署应用.浏览器关闭时不会关闭,并且不会因选项卡更改而失去焦点.
    2. 如果 1 个带有链接的页面中嵌入了 3 个带有控件的小程序,那么焦点是什么?由于 Sun 从不费心指定应该发生什么(根据他们的说法),因此随着时间的推移,JRE 之间的情况有所不同.现在,JRE 为小程序获取焦点是很常见的.如果是这样,通常无法(单独)使用键盘访问网页中的链接和其他可聚焦元素.
    3. 调整桌面应用的大小要容易得多.
    4. 一款桌面应用.(带有启动画面、带有图标的桌面快捷方式等)可以看起来更专业.

当然要提到的是,线条变得模糊了:

  1. 自从引入 JWS 以来,它可以启动小程序
  2. 自 Plug-In 2 架构 JRE 以来,JWS 可以启动嵌入在网页中的小程序.

<块引用>

..我们正在尝试使安装了 Java 的每台机器都可以使用,而无需安装它.

我会把无需安装"的要求放在一边,因为时间总是在流逝,并且需要更新插件.关于这一点,请使用 deployJava.js 处理 JRE 最低版本检查.该脚本将在检查最低 Java 可用后嵌入小程序或写入 JNLP 启动文件的链接.

另见

堆栈溢出信息.标签页:

What do you think are the advantages/disadvantages of a Java Web Start project against an Java Applet? We're trying to figure out what type we should use for our new application. We've already developed an Desktop App (JAR) and we're trying to make is useable from every machine, which has Java installed, without the need of installing it.

Any thoughts?

解决方案

  1. Applet/browser/JRE interaction problems. If you don't know what I mean, don't even have an inkling (from lost hair) then deploying applets will be a steep learning curve.
  2. What does the browser bring to the deal? If the answer is JS interactivity, integration with an existing HTML based web app., or a few other related things, plenty. If not, then ask yourself what the advantage of deploying the app. wrapped in a browser window really is?
  3. JWS Jar caching and update is more reliable (and can be taken under programmatic control, if needed).
  4. The AppletContext provides some ability for an applet to interact with the environment, but the JNLP API goes beyond what the AC can achieve (mostly).
  5. General usability. These may or may not be a problem for your use-case.

    1. A free floating JWS deployed app. does not get closed when the browser gets closed, and does not suffer focus loss on tab change.
    2. If 3 applets each with controls are embedded in 1 page with links, what gets focus? Since Sun never bothered to specify what should happen (according to them) it has been different across JREs over time. Now it is common for the JRE to grab focus for the applets. If it does, it it generally impossible to use the keyboard (alone) to get to the links and other focusable elements in the web page.
    3. It is far easier to resize a desktop app.
    4. A desktop app. (with splash screen, desktop shortcut with icon etc.) can look much more professional.

Of course, it should be mentioned that the lines become blurred:

  1. Since JWS was introduced, it could launch applets
  2. Since the Plug-In 2 architecture JRE, JWS could launch applets that remained embedded in a web page.

..we're trying to make is useable from every machine, which has Java installed, without the need of installing it.

I would sweep aside the 'without the need of installing it' requirement of that since there is always the passage of time and the need for updating plug-ins. On that note, use deployJava.js to handle JRE minimum version checking. The script will either embed an applet or write a link to a JNLP launch file after checking minimum Java is available.

See also

The Stack Overflow info. pages for tags:

这篇关于Java Web Start (JNLP) 相对于 Java Applet 的优势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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