Java 应用程序(带有损坏的沙箱)与 Web 应用程序
我和我的公司正处于将基于 Java 的应用程序移植(或重写)到 Web 的早期规划阶段。它是一个自动发音的 SVG 编辑器和查看器,强调可访问性。它是一个成熟的项目,目前仅作为 Windows 应用程序部署。它有几个本机依赖项 (JNI):
- Windows 语音 API (SAPI)
- 自定义设备驱动程序(很少有用户利用)。
我之前曾尝试过签名小程序,并且知道如果需要,我可以在浏览器中访问这些本机例程。但这是正确的方法吗? 在我看来,将功能齐全的 Java 应用程序硬塞到 Web 浏览器中是对技术的滥用。它肯定不是传统意义上的网络应用程序。
如果有足够的时间,应用程序的大部分功能都可以通过相当简单的 HTML、CSS 和 JavaScript 来复制。如果系统更改为基于 Web 的客户端-服务器模型,我可以传输声音文件,从而消除对客户端的 SAPI 依赖。设备驱动程序会更加棘手,但在这种情况下,一个不可见的、可编写脚本的 Java 小程序可能是合理的。
我意识到这有点主观,但我正在寻找对上述假设的确认。我看到 Web 正在放弃单一的 Java/Flash 应用程序,转而采用 HTML+JavaScript 的 UI。我正在寻找最好的“面向未来”且独立于平台的方法。
(版主:如果需要,标记为主观)
My company and I are in the early planning stages of porting (or rewriting) a Java-based application to the web. It is a self-voicing SVG editor and viewer emphasizing accessibility. It is a mature project that is currently deployed as a Windows application only. It has several native dependencies (JNI):
- Windows Speech API (SAPI)
- custom device drivers (which fewer users take advantage of).
I have experimented with signed applets before and know I can access these native routines in the browser, if needed. But is that the right approach? In my mind, shoehorning a full-featured Java application into the web browser is a mis-use of technology. It would certainly not be a web app, in the traditional sense.
Given enough time, much of the application's functionality could be replicated with fairly simple HTML, CSS, and JavaScript. If the system were changed to a web-based client-server model, I could stream sound files, eliminating the SAPI dependency on the client end. Device drivers would be more tricky, but an invisible, scriptable Java applet may be justifiable in this instance.
I realize this is somewhat subjective, but I am looking for confirmation on the above assumptions. I see the web abandoning monolithic Java/Flash applications in favor of HTML+JavaScripted UIs. I am looking for the best "future-ready" and platform independent approach.
(Moderators: flag as subjective, if needed)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如今,当人们用 Java 编写 Web 应用程序时,前端通常是 (X)HTML+CSS,并使用 Javascript 操作 DOM。通过 AJAX 进一步加强交互。
但这并不否定 Java 的使用。通常,您的所有业务逻辑仍将在服务器端完成,通常在 Java servlet 中完成,该 servlet 服务来自前端的请求。
所以,是的,总的来说,Web 正在逐渐远离以 Java 小程序实现 UI 的 Web 应用程序,但 Java 在 Web 应用程序市场中的作用比以往任何时候都更强大。
When people write web apps in Java these days, the front end is typically (X)HTML+CSS with Javascript manipulating the DOM. Interaction is furthered with AJAX.
That doesn't negate the use of Java however. Typically all of your business logic will still be done on the server side, often in a Java servlet which services request from the front end.
So yes, in general the Web is moving away from Web apps with the UI implemented as a Java applet, but Java is stronger than ever in its role for the Web app market.