简体   繁体   English

Java EE应用程序中的Applet访问蓝牙外围设备客户端

[英]Applet in Java EE application to access Bluetooth peripheral client

I currently have a Java EE application on a server. 我目前在服务器上有一个Java EE应用程序。 It is using struts2 and Hibernate. 它正在使用struts2和Hibernate。 I need to acces to the client computer and search for all the MAC address of the bluetooth peripheral detected by the client computer. 我需要访问客户端计算机并搜索客户端计算机检测到的蓝牙外围设备的所有MAC地址。

So the problem is : how to access to the client computer ? 所以问题是:如何访问客户端计算机? Do I have to use a Java Applet ? 我必须使用Java Applet吗? My teacher say that the applet are really sensitive to the version of Java installed on the client computer! 我的老师说小程序对客户端计算机上安装的Java版本确实很敏感! That would be a problem if an applet designed for Java 5 would not run with Java 6 ! 如果为Java 5设计的小程序不能与Java 6一起运行,那将是一个问题!

Is it true? 是真的吗 Is there any other solution than the applet ? 除了applet以外,还有其他解决方案吗?

how to access to the client computer ? 如何访问客户端计算机? Do I have to use a Java Applet ? 我必须使用Java Applet吗?

I don't know if it is the only way, but a trusted applet could have a shot at getting the information. 我不知道这是否是唯一的方法,但是可信任的applet可能会尝试获取信息。 I say 'have a shot' in the sense that it is unlikely core Java SE provides the functionality for this task, so you will probably need to look into using natives for each system. 我说“大胆尝试”的意思是,核心Java SE不太可能提供此任务的功能,因此您可能需要研究对每个系统使用本机。

My teacher say that the applet are really sensitive to the version of Java installed on the client computer! 我的老师说小程序对客户端计算机上安装的Java版本确实很敏感! That would be a problem if an applet designed for Java 5 would not run with Java 6 ! 如果为Java 5设计的小程序不能与Java 6一起运行,那将是一个问题!

No, it is the other way around. 不,这是另一回事。 If an applet is compiled for Java 6, it will not run on Java 5. But an applet designed to run in Java 5 should have no problems running in a version 6 JVM. 如果applet是 Java 6编译 ,则它将不能在Java 5上运行。但是设计为在Java 5中运行的applet在版本6 JVM中应该没有问题。

As to the problems that arise from that, they are easily solvable: 关于由此产生的问题,可以轻松解决:

  1. Use deployJava.js for ensuring a particular minimum Java version, and it should handle the 'heavy lifting' of one of: 使用deployJava.js来确保特定的最低Java版本,它应该处理以下其中一项的“繁重任务”:
    1. Checking the user has a suitable minimum JRE and writing an applet element for it. 检查用户是否具有合适的最小JRE并为其编写一个applet元素。
    2. Helping the user through an upgrade (then going onto 1) 帮助用户进行升级(然后转到1)
    3. Informing the user why the applet won't work. 通知用户小程序为什么不起作用。
  2. The same situation applies to any code run on the desktop, whether it is an applet, an app. 相同的情况适用于在桌面上运行的任何代码,无论是小应用程序还是应用程序。 that runs in the command line, or a desktop app. 在命令行或桌面应用程序中运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM