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

10,781

Solution 1

<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)

Solution 2

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.

Share:
10,781
Admin
Author by

Admin

Updated on June 26, 2022

Comments

  • Admin
    Admin almost 2 years

    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