File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp - java plugin - applet.

 
arul narayan
Greenhorn
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jason Menard
Sheriff
Posts: 6450
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic