What's wrong with my object tag to embed a Java Applet?
Asked Answered
F

2

6

Here is my object tag.

    <object classid="java:my.full.class.Name.class"
            height="360" width="320">
        <param name="type" value="application/x-java-applet">
        <param name="archive" value="applets.jar">
        <param name="file" value="/report_files/1-1272041330710YAIwK">
        <param name="codebase" value="/applets">
    </object>

When I run this in firefox it just shows up with an Error, click for details. The java console shows absolutely nothing. And at the bottom of fire fox is says "Applet my.full.class.Name notloaded". The Name.class file is in the applets.jar file. I can type the URL /applets/applets.jar and access the jar file. So whats wrong?

EDIT: I can access the param file as well, although I don't believe that is the issue.

EDIT: I updated the tag because I noticed in my HTML logs it wasn't looking in the right place. Still nothing though

Farm answered 28/4, 2010 at 14:6 Comment(0)
R
3
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" 
    codebase="http://java.sun.com/update/1.6.0/jinstall-1_6-windows-i586.cab#Version=1,6,0,0"
    code="my.full.class.Name"
    archive="/applets/applets.jar" ... />

See the documentation!

(and you must not add .class to fully-qualified class names)

Regardless answered 28/4, 2010 at 14:24 Comment(3)
That yields 0 result now in fire fox. I am assuming because of the classid from what I can read that is how IE is setup to use the object tag to render an applet.Farm
@predhme - you must not specify .class.Regardless
I guess I discovered that as you mentioned it. Thanks.Farm
M
1

Firefox fails with a classid attribute. The below should work cross browser:-

<p>
<object type="application/x-java-applet"
    name="previewersGraph" width="360" height="320">
    <param name="codebase" value="/applets" />
    <param name="code" value="my.full.class.Name" />
    <param name="archive" value="applets.jar" />
    <param name="scriptable" value="true" />
    <param name="mayscript" value="true" />
    <param name="file" value="/report_files/1-1272041330710YAIwK" />
</object>
</p>

In my tests both IE8 and FF5 required the "type" attribute. The mayscript param is only required for Java plugins before 1.6.0.10. The scriptable param is still required according to javadocs 1.6.0.21. However, in a test with 1.6.0.24 for a signed applet, IE8 called it OK from JS without scriptable being set true.

Michalmichalak answered 27/7, 2011 at 14:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.