JDK-6648488 : Add JavaScript syntax for per-applet class and static method access
  • Type: Enhancement
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-01-09
  • Updated: 2010-09-08
  • Resolved: 2008-06-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u10 b11Fixed 7Fixed
Related Reports
Relates :  
Description
A request has been made on the java.net forum for access from JavaScript to static methods of an applet's classes, not just to the global Java namespace. This should be implementable in the new plug-in with syntax like

  myApplet.Packages.com.foo.Bar.baz()

assuming there is an applet on the page whose ID is "myApplet".

See http://forums.java.net/jive/thread.jspa?threadID=35072&tstart=0 for the original discussion.

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/deployment_data/6u10/6648488.0 testcase: http://j2se.east.sun.com/deployment/www/tests/1.6.0_10/6648488
10-01-2008

EVALUATION Added support for the "Packages" keyword against the applet object, providing the necessary scoping to allow access to user-level classes including static fields, static methods and instantiation of new objects. The syntax looks like: applet1.Packages.com.company1.HelperClass.staticField or new applet1.Packages.com.company1.HelperClass() where "applet1" is the ID of the applet defined on the web page. The changes needed were to keep track of which object is the top-level object (i.e., the applet) exported to the web browser, and to inject support for the magic "Packages" keyword against only that object, returning a new top-level JavaNameSpace object for that field fetch. All of the other necessary infrastructure was already in place. Verified the new functionality both in IE and Firefox 3.
10-01-2008