问题和练习的答案:Java Web Start

Questions

答案: 您将应用程序的JNLP文件名用作href属性的值。当用户单击指向JNLP文件的链接时,Java Web Start 将加载该JNLP文件指定的应用程序。

答案: 您必须配置 Web 服务器,以便将 extensions 为.jnlp 的文件设置为application/x-java-jnlp-file MIME 类型。

答案: resources元素必须包含:

答案: B. DownloadServiceinterface为应用程序提供了控制如何缓存其自身资源的功能。

答案: 正确**。

答案: False **。该应用程序的所有 JAR 文件都必须位于同一服务器上。

答案: 您必须在.jnlp 文件中包含security元素,并指定all-permissions才能使您的应用程序在沙盒之外运行。

Exercises

Answer:

<security>
   <all-permissions/>
</security>

Answer:

// Get current classloader
ClassLoader cl = this.getClass().getClassLoader();
// Create icons
Icon firstIcon  = new ImageIcon(cl.getResource("images/one.gif"));
Icon secondIcon   = new ImageIcon(cl.getResource("images/two.gif"));
首页