简体   繁体   English

Applet param标签的用途是什么?

[英]What is the use of the Applet param tag?

Forgive me if this question is stupid, however what is the point of the param tag? 如果这个问题很愚蠢,请原谅我,但是param标签的意义是什么? I have watched videos and read tutorials and pretty much understand what it does, but don't understand the why? 我看过视频并阅读了教程,几乎了解了它的功能,但不明白为什么? It seems the user can't use this param tag to input data, but the programmer sets the values (from what I've seen). 似乎用户无法使用此param标签输入数据,但是程序员设置了值(根据我所见)。 So why is it used when we can simply do all that in the .java file? 那么当我们可以简单地在.java文件中完成所有操作时,为什么要使用它呢? A practical example would be appreciated, thanks! 一个实际的例子将不胜感激,谢谢!

You don't have to recompile anything if the param changes. 如果参数更改,则无需重新编译任何内容。 You can just edit html with text editor and voilà! 您可以只使用文本编辑器和voilà编辑html! Also reusability of code with different params on different pages. 在不同页面上具有不同参数的代码也可重用。

Basically it's the same question as "why do we need *.properties file when you can hardcode all the properties as public static String fields in some class?". 基本上,这与“为什么可以在某个类中将所有属性硬编码为public static String字段时为什么需要* .properties文件?”相同。

A simple example might be a general-purpose menu applet. 一个简单的示例可能是通用菜单小程序。 You don't want to have the menu existing in code, because you might want to change it or have different menus on different web pages. 您不想在代码中存在菜单,因为您可能想要更改它或在不同的网页上拥有不同的菜单。 The menu to display can easily be defined in param tags. 可以在param标签中轻松定义要显示的菜单。

  1. You can have a component that displays advertisements/captchas/whatever and requires a public key. 您可以具有一个显示广告/验证码/任何内容的组件,并且需要公共密钥。 The same component (without recompiling) can be embedded on several sites. 相同的组件(无需重新编译)可以嵌入到多个站点中。 The public key is passes as a parameter. 公钥作为参数传递。

  2. The applets' look-and-feel (background colour, font sizes, etc.) can be customized to better match overall web-page layout. 可以自定义applet的外观(背景颜色,字体大小等),以更好地匹配整体网页布局。

  3. Marvelous flying unicorn animation can have customizable speed and unicorn colour. 奇妙的飞行独角兽动画可以具有可自定义的速度和独角兽颜色。

在中指定属性<applet>标签<div id="text_translate"><p>我们有一个小程序,一个存储在桌面上的 jar 文件,一个门户站点的页面之一调用这个小程序。</p><p> 我们在某些环境中遇到了小程序未初始化的问题,调查导致检查了调用 jar 的标签。</p><p> 我们不确定是否需要在标签中使用“codebase”属性。 (不幸的是,我们不能简单地测试它。)</p><p> 到目前为止,我们在 applet 标签中拥有的是指定的“code”属性和引用本地机器上文件的“Archive”属性,如下所示:</p><pre> Archive='file:///WINDOWS/XYfolder/some.jar'</pre><p> W3C 表示,“codebase”属性指定用于解析由 classid、data 和<strong>archive 属性</strong>指定的相对 URI 的基本路径。 <strong>如果不存在,其默认值为当前文档的基本 URI。</strong> (这意味着它会在我猜的服务器上查找 jar 文件)。</p><p> 对于'Archive' W3C 所说,此属性可用于为包含与 object 相关的资源的存档指定以空格分隔的 URI 列表,其中可能包括由 classid 和 data 属性指定的资源。 预加载档案通常会减少对象的加载时间。 <strong>指定为相对 URI 的档案应相对于代码库属性进行解释。</strong></p><p> <em>- 我的问题是如何在存档属性中指定相对 URI 以及如何指定绝对 URI?</em></p><p> <em>- 上面指定的存档属性是相对 URI 还是绝对 URI?</em></p><p> 非常感谢</p></div></applet> - Specifying attributes in the <applet> tag

暂无
暂无

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

相关问题 Hibernate中param的用途是什么 <generator> 标签? - what is the use of param in Hibernate <generator> tag? 如何从JavaScript或jQuery设置applet param标签 - How to set applet param tag from JavaScript or jQuery 将变量合并到 <Applet> 用于CMS(Joomla)的标签 - Incorporating variable into <Applet> tag for use in CMS (Joomla) Applet参数不保留CRLF - Applet param not preserving CRLFs 在 <applet> 标签 - configuring applet options in the <applet> tag 我的object标签嵌入Java Applet有什么问题? - What's wrong with my object tag to embed a Java Applet? XSS和Applet / Param HTML关键字 - XSS and Applet/Param HTML Keywords Thread构造函数与字符串param有什么用? - What the use of Thread constructor with string param? 将多行放在Javadoc的param标记中的正确方法是什么? - What is the correct way put multiple lines in a param tag for a Javadoc? 在中指定属性<applet>标签<div id="text_translate"><p>我们有一个小程序,一个存储在桌面上的 jar 文件,一个门户站点的页面之一调用这个小程序。</p><p> 我们在某些环境中遇到了小程序未初始化的问题,调查导致检查了调用 jar 的标签。</p><p> 我们不确定是否需要在标签中使用“codebase”属性。 (不幸的是,我们不能简单地测试它。)</p><p> 到目前为止,我们在 applet 标签中拥有的是指定的“code”属性和引用本地机器上文件的“Archive”属性,如下所示:</p><pre> Archive='file:///WINDOWS/XYfolder/some.jar'</pre><p> W3C 表示,“codebase”属性指定用于解析由 classid、data 和<strong>archive 属性</strong>指定的相对 URI 的基本路径。 <strong>如果不存在,其默认值为当前文档的基本 URI。</strong> (这意味着它会在我猜的服务器上查找 jar 文件)。</p><p> 对于'Archive' W3C 所说,此属性可用于为包含与 object 相关的资源的存档指定以空格分隔的 URI 列表,其中可能包括由 classid 和 data 属性指定的资源。 预加载档案通常会减少对象的加载时间。 <strong>指定为相对 URI 的档案应相对于代码库属性进行解释。</strong></p><p> <em>- 我的问题是如何在存档属性中指定相对 URI 以及如何指定绝对 URI?</em></p><p> <em>- 上面指定的存档属性是相对 URI 还是绝对 URI?</em></p><p> 非常感谢</p></div></applet> - Specifying attributes in the <applet> tag
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM