-
Bug
-
Resolution: Fixed
-
P2
-
6u10
The following sample demonstrates a problem of JavaScript calling Java. This issue is only reproducible with New Java Plug-In. It is not reproducible with Classic Java Plug-In in 6u10.
Env:
6u10, XP, IE.
<applet code>
import javax.swing.JApplet;
public class SimpleApplet extends JApplet {
private static final long serialVersionUID = -681454679772431812L;
/** Initializes the applet GOSEApplet */
public void init() {
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
System.out.println("SimpleApplet.init()");
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void start() {
System.out.println("SimpleApplet.start()");
}
public void stop() {
System.out.println("SimpleApplet.stop()");
}
public void destroy() {
System.out.println("SimpleApplet.destroy()");
}
/*
* Meant to be called by JavaScript on HTML page
*/
public void echoPrint(String message) {
System.out.println("In SimpleApplet.echoPrint(): "+message);
}
}
</applet code>
And here is the HTML page:
<HTML>
<HEAD>
<TITLE> SimpleApplet </TITLE>
</HEAD>
<BODY>
<OBJECT name="simpleApplet" classid="clsid:CAFEEFAC-0015-0000-FFFF-ABCDEFFEDCBA" width="1" height="1">
<PARAM name="name" value="simpleApplet">
<PARAM name="code" value="SimpleApplet.class">
<PARAM name="archive" value="SimpleApplet.jar">
<PARAM name="codebase" value="applets">
</OBJECT>
<script type="text/javascript">
document.simpleApplet.echoPrint("TEST1");
</script>
</BODY>
</HTML>
Expected Output:
SimpleApplet.init()
SimpleApplet.start()
In SimpleApplet.echoPrint(): TEST1
Env:
6u10, XP, IE.
<applet code>
import javax.swing.JApplet;
public class SimpleApplet extends JApplet {
private static final long serialVersionUID = -681454679772431812L;
/** Initializes the applet GOSEApplet */
public void init() {
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
System.out.println("SimpleApplet.init()");
}
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
public void start() {
System.out.println("SimpleApplet.start()");
}
public void stop() {
System.out.println("SimpleApplet.stop()");
}
public void destroy() {
System.out.println("SimpleApplet.destroy()");
}
/*
* Meant to be called by JavaScript on HTML page
*/
public void echoPrint(String message) {
System.out.println("In SimpleApplet.echoPrint(): "+message);
}
}
</applet code>
And here is the HTML page:
<HTML>
<HEAD>
<TITLE> SimpleApplet </TITLE>
</HEAD>
<BODY>
<OBJECT name="simpleApplet" classid="clsid:CAFEEFAC-0015-0000-FFFF-ABCDEFFEDCBA" width="1" height="1">
<PARAM name="name" value="simpleApplet">
<PARAM name="code" value="SimpleApplet.class">
<PARAM name="archive" value="SimpleApplet.jar">
<PARAM name="codebase" value="applets">
</OBJECT>
<script type="text/javascript">
document.simpleApplet.echoPrint("TEST1");
</script>
</BODY>
</HTML>
Expected Output:
SimpleApplet.init()
SimpleApplet.start()
In SimpleApplet.echoPrint(): TEST1
- duplicates
-
JDK-6699613 Plugin2: bank's login applet throws NPE and fails to initialized
- Closed
- relates to
-
JDK-6790892 jre1.6.0_11 has problems starting applets (race condition not fixed)
- Closed