aspose file tools*
The moose likes Servlets and the fly likes jsp - java plugin - applet. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "jsp - java plugin - applet." Watch "jsp - java plugin - applet." New topic
Author

jsp - java plugin - applet.

arul narayan
Greenhorn

Joined: Sep 26, 2000
Posts: 17
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
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
arul narayan
Greenhorn

Joined: Sep 26, 2000
Posts: 17
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp - java plugin - applet.
 
Similar Threads
Unable to load Applet in Tomcat 5.5.12
Can remove listeners added to applet componenets from jsp?
Unable to load Applet in Tomcat 5.5.12
JDK 1.5 Compiled Applet not working with JRE 1.4
ClassNotFoundException with Java Plugin