Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<Object> instead <applet>

Status
Not open for further replies.

botatun

Programmer
Mar 7, 2006
40
US
Hi, I have an applet that I call on my jsp page like this

<applet codebase = "/applet"
code= "testapplet/Test01.class"
name = "Test" width="550" height="300"> </applet>

W3 consortium said that applet is deprecated.
How to use <object> instead <applet> tag? I try this one:

<object classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase = " id="Chart" >
<PARAM NAME = CODE VALUE = "applet.testapplet.Test01.class" >
</object>

but it did not find the Test01.class.
 
Hi Dian,
This is how created mine, but it did not found a class.

This is a question is this statement correct?
<PARAM NAME = CODE VALUE = "applet.testapplet.Test01.class" >

 
Which package is your class in?
Which errors are shown in the console?

Cheers,
Dian
 
Package testapplet
Directory: ROOT/applet
I use tomcat server.
 
Then your classname should be testapplet.applet and it must ben on a testapplet directory.

Server doesn't affect: applets are executed client-side.

Cheers,
Dian
 
Maybe I explain wrong:

webapps/ROOT/applet/testapplet/Test01.class
That's why I put "applet.testapplet.Test01.class"

And this is what I got on JRE consol:

java.lang.NoClassDefFoundError: applet/testapplet/Test01 (wrong name: testapplet/Test01)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

I tired "testapplet.applet.Test01.class" but it did not work and give me the same.


 
Okay, I test another things. I put Test01.jsp in applet directory and remove "applet" from code name and it is work.
But I cannot make it work, when I move it out of applet directory and add applet to code.
What is a trick to make a path to applet directory?
 
I've got it i add
<PARAM NAME = CODEBASE VALUE = "/applet">
and chage this one to:
<PARAM NAME = CODE VALUE = "testapplet.Test01.class">
and it is start to work.

Thank you Dian for your patient.

Vadim


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top