We need a convention so JavaScript can reference Java packages, classes, create new objects, and reference static members.
The LiveConnect way is to use a global Packages objects. For example:
var myString = new Packages.java.lang.String("Hello world");
Traditionally, java and netscape are prefined as providing shortcuts; we might also consider sun, javax, and javafx.
http://jdk6.java.net/plugin2/liveconnect/#PER_APPLET_PACKAGES
http://jdk6.java.net/plugin2/liveconnect/#DEPRECATED_FUNCTIONALITY
https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/LiveConnect_Overview#The_Packages_Object
The LiveConnect way is to use a global Packages objects. For example:
var myString = new Packages.java.lang.String("Hello world");
Traditionally, java and netscape are prefined as providing shortcuts; we might also consider sun, javax, and javafx.
http://jdk6.java.net/plugin2/liveconnect/#PER_APPLET_PACKAGES
http://jdk6.java.net/plugin2/liveconnect/#DEPRECATED_FUNCTIONALITY
https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/LiveConnect_Overview#The_Packages_Object
- blocks
-
JDK-8101298 JavaScript to Java method calls in Web component [# 752342]
-
- Closed
-
- duplicates
-
JDK-8101553 Similar mechanism exists in InternetExplorer with "window.external"
-
- Closed
-
-
JDK-8100829 Enhance Browser integration with java
-
- Closed
-
-
JDK-8101190 Provide a way for JavaScript running in WebView to execute methods on Java objects, and for Java to call back into JavaScript
-
- Closed
-
- relates to
-
JDK-8097712 enable calling Java methods and creating Java objects from JavaScript
-
- Closed
-