在 <applet> 中指定属性标签 [英] Specifying attributes in the <applet> tag

查看:22
本文介绍了在 <applet> 中指定属性标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个小程序,一个存储在桌面上的 jar 文件,门户网站的一个页面称为这个小程序.

我们遇到了小程序在某些环境中未初始化的问题,调查导致检查调用 jar 的标签.

我们不确定是否需要在标签中使用codebase"属性.(不幸的是,我们不能简单地对其进行测试.)

到目前为止,我们在 applet 标签中拥有的是指定的code"属性和引用本地机器上的文件的Archive"属性,如下所示:

Archive='file:///WINDOWS/XYfolder/some.jar'

W3C 表示codebase"属性指定用于解析由 classid、数据和归档属性 指定的相对 URI 的基本路径.如果不存在,它的默认值是当前文档的基本 URI.(我猜这意味着它会在服务器上查找 jar 文件).

对于'Archive' W3C 说,此属性可用于为包含与对象相关的资源的档案指定一个以空格分隔的 URI 列表,其中可能包括由 classid 和 data 属性指定的资源.预加载档案通常会减少对象的加载时间.指定为相对 URI 的档案应相对于代码库属性进行解释.

- 我的问题是如何在存档属性中指定相对 URI 以及如何指定绝对 URI?

- 上面指定的 Archive 属性是相对还是绝对 URI?

非常感谢

解决方案

..如何在存档属性中指定相对 URI 以及如何指定绝对 URI?

例如

亲属

//icon.gif 可以在与该目录同级的 docs 目录中找到../docs/icon.gif"//icon.gif 可以在该目录下的 docs 目录中找到./docs/icon.gif"

绝对

//网络资源的完整路径http://pscode.org/media/stromlo2.jpg"//本地资源的绝对路径"file:///WINDOWS/XYfolder/some.jar"

<块引用>

上面指定的 Archive 属性是相对 URI 还是绝对 URI?

绝对引用.

<小时>

请注意,小程序通常不应该从最终用户的计算机上加载 Jars(除非 JRE 在本地缓存了它们 - 但这对应用程序来说都是不可见的".).这很可能是这里真正的问题.

We have an applet, a jar file that is stored on the desktops and one of the pages of a portal site calls this applet.

We have issues with the applet not initialising in some of the environments and the investigation led to checking the tag where the jar is called.

We are not sure whether we need to use the 'codebase' attribute in the tag. (And we can't just test it easily unfortunately.)

What we have so far in the applet tag is the 'code' attribute that is specified and the 'Archive' attributes which refers to a file on the local machines like this:

Archive='file:///WINDOWS/XYfolder/some.jar'

W3C says that the 'codebase' attribute specifies the base path used to resolve relative URIs specified by the classid, data, and archive attributes. When absent, its default value is the base URI of the current document. (which means it would look for the jar file on the server I guess).

For 'Archive' W3C says, this attribute may be used to specify a space-separated list of URIs for archives containing resources relevant to the object, which may include the resources specified by the classid and data attributes. Preloading archives will generally result in reduced load times for objects. Archives specified as relative URIs should be interpreted relative to the codebase attribute.

- My question is how do you specify a relative URI in the archive attribute and how do you specify an absolute URI?

- Is the Archive attribute specified above as relative or absolute URI?

Many thanks

解决方案

..how do you specify a relative URI in the archive attribute and how do you specify an absolute URI?

E.G.

Relative

// icon.gif can be found in the docs directory that is a sibling to this directory
"../docs/icon.gif"  
// icon.gif can be found in the docs directory that is a child to this directory
"./docs/icon.gif"

Absolute

// a complete path to a web resource
"http://pscode.org/media/stromlo2.jpg"
// an absolute path to a local resource
"file:///WINDOWS/XYfolder/some.jar"

Is the Archive attribute specified above as relative or absolute URI?

It is an absolute reference.


Note that an applet should not typically be loading Jars off the computer of the end-user (unless they were cached locally by the JRE - but that is all 'invisible' to the app.). That is most likely the real problem here.

这篇关于在 &lt;applet&gt; 中指定属性标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆