Hi all, My jsp successfully loaded applet using java plugin when I used normal code as below: <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "300" HEIGHT = "100" > <PARAM NAME="code" VALUE="appletclassname.class"> <PARAM NAME="codebase" VALUE="/path/"> <PARAM NAME="archive" VALUE="appletjar.jar"> <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"> Now I am trying to call a method in the applet from onClick of a button in the jsp. I get "Object does not support this property or method" error. Can someone enlighten me the mistake and provide a solution. Thanks.
arul.
Jason Menard
Sheriff
Joined: Nov 09, 2000
Posts: 6450
posted
0
You cannot use JavaScript in a JSP to Java methods, be they in the JSP or an embedded applet, or anywhere else for that matter. Jason Menard
I have successfully worked out a solution. On the Click of a button in my JSP, I call a javascript function which does: win=window.open("with usual parameters"); and I dynamically load the plugin with all the parms as follows: win.document.writeln('<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" WIDTH = "300" HEIGHT = "100" > <PARAM NAME="code" VALUE="appletclassname.class"> <PARAM NAME="codebase" VALUE="/path/"> <PARAM NAME="archive" VALUE="appletjar.jar"> <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3"></OBJECT>'); This also solves my original requirement to load the plugin only on a button click and also to call a particular method in the applet after the button click.