United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6742245 Support calling non-Java languages from JavaScript
6742245 : Support calling non-Java languages from JavaScript

Details
Type:
Enhancement
Submit Date:
2008-08-27
Status:
Closed
Updated Date:
2011-05-13
Project Name:
JDK
Resolved Date:
2008-10-02
Component:
deploy
OS:
generic
Sub-Component:
plugin
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u10,6u12
Fixed Versions:
6u10

Related Reports
Backport:
Duplicate:
Relates:

Sub Tasks

Description
The new Java Plug-In has abstracted the Java/JavaScript bridge between different web browsers. It is now strongly desired to support calling from JavaScript on a web page into objects of non-Java languages hosted on the JVM. It will be necessary to expose hooks to allow the run-time systems of these JVM-based languages to detect invocations, field accesses, etc. that they should handle; perform data type conversions; delegate down to default data type conversions already provided by the Java Plug-In; etc. The first consumer of this functionality will be the run-time system for JavaFX.

                                    

Comments
SUGGESTED FIX

webrev: http://sa.sfbay.sun.com/projects/deployment_data/6u10/6742245.1
testcase: http://j2se.east.sun.com/deployment/www/tests/1.6.0_10/6742245/
                                     
2008-09-22
EVALUATION

Added hooks to the JavaScript/Java bridge and APIs in the com.sun.*
namespace to allow third-party languages implemented on the JVM to
interpose on method calls, field accesses, and other operations. With
these hooks, the language implementor can define a mapping between
JavaScript syntax in the browser and their own language. JavaScript on
the web page can then call into applets written in these other
languages, like JRuby, Jython and Groovy. The first consumer of this
functionality and the principal use case is JavaFX Script.

The test case contains a link to the javadoc, which describes how a
language implementor would use the new APIs. Once this work is checked
in, code will be checked in to the JavaFX compiler workspace which
uses it to build the JavaScript/JavaFX Script bridge.

The changes are largely a refactoring of existing code, not logic
changes. Careful thought has been given to the security ramifications
of this feature; see in particular BridgeFactory.getBridge().
                                     
2008-09-22



Hardware and Software, Engineered to Work Together