|     | Start of Tutorial > Start of Trail > Start of Lesson | Search Feedback Form | 
 
- Question: In a link that is to run a Java Web Start application, which file is specified as the
atag'shrefattribute?Answer: You use the application's
JNLPfile name as the value of thehrefattribute. When a user clicks the link to theJNLPfile, Java Web Start loads the application specified by thatJNLPfile.
- Question: Which MIME type must a Web server recognize in order for it to host Java Web Start applications?
Answer: You must configure the Web server so that files with the .jnlp extension are set to the
application/x-java-jnlp-fileMIME type.
- Question: In an application's
JNLPfile, which two elements must be specified within theresourceselement?Answer: The
resourceselement must contain:
- The
j2seelement, which specifies the Java platform on which to run the application.- The
jarelement, which specifies the JAR file for the application.
- Question: Which interface provides the ability to control how the Java Web Start application's resources are cached?
BasicService
DownloadService
PersistenceService
ExtendedServiceAnswer: B. The
DownloadServiceinterface provides the ability to control how the application's resources are cached.
- Question: True or False: Java Web Start applications run in a secure sandbox by default.
Answer: True.
- Question: True or False: If a Java Web Start application is running in a secure sandbox, JAR files for the application can reside on different servers.
Answer: False. All JAR files for the application must reside on the same server.
- Question: For a Java Web Start application to support operations outside of the secure sandbox, what must you do with its JAR files?
Answer: You must sign JAR files to enable your application can work outside of the sandbox.
- Exercise: Write the XML code you would add to a
JNLPfile in order to request that the application have complete access to the client system.Answer:
<security> <all-permissions/> </security>
- Exercise: For a Java Web Start application, you have two icons,
one.gifandtwo.gif, in theimagesdirectory in a JAR file. Write the application code you would use to access these images.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"));
 
|     | Start of Tutorial > Start of Trail > Start of Lesson | Search Feedback Form | 
Copyright 1995-2005 Sun Microsystems, Inc. All rights reserved.