简体   繁体   English

我的object标签嵌入Java Applet有什么问题?

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

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. 当我在firefox中运行它时,它只显示错误,单击以获取详细信息。 The java console shows absolutely nothing. java控制台绝对没有任何显示。 And at the bottom of fire fox is says "Applet my.full.class.Name notloaded". 在火狐的底部是“Applet my.full.class.Name notloaded”。 The Name.class file is in the applets.jar file. Name.class文件位于applets.jar文件中。 I can type the URL /applets/applets.jar and access the jar file. 我可以输入URL /applets/applets.jar并访问jar文件。 So whats wrong? 那么什么是错的?

EDIT: I can access the param file as well, although I don't believe that is the issue. 编辑:我也可以访问param文件,虽然我不相信这是问题。

EDIT: I updated the tag because I noticed in my HTML logs it wasn't looking in the right place. 编辑:我更新了标签,因为我注意到我的HTML日志中没有找到正确的位置。 Still nothing though 但仍然没有

<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) (并且您不能将.class添加到完全限定的类名)

Firefox fails with a classid attribute. Firefox失败并带有classid属性。 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. 在我的测试中,IE8和FF5都需要“type”属性。 The mayscript param is only required for Java plugins before 1.6.0.10. 只有1.6.0.10之前的Java插件才需要mayscript参数。 The scriptable param is still required according to javadocs 1.6.0.21. 根据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. 但是,在使用1.6.0.24进行签名applet的测试中,IE8在没有脚本化设置为真的情况下从JS调用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM