Java Reference
In-Depth Information
Using Java Web Start, there are three ways to launch the application. First is to
embed a link to the JNLP deployment file in a Web page, which could look like this:
<a href="dist/NasaImageBrowser.jnlp">Launch with Java Web
Start</a>
The second way is to associate the Java Web Start mime type, application/x-
java-jnlp-file , to the JNLP file type (.jnlp) in your operating system. Then,
when the user clicks on the JNLP file, the application will automatically start.
This association should have been set up when Java was installed on the platform.
The third way is to create a desktop launcher. If you include the <shortcut> hint
in the <information> section of the JNLP file, the Java Web Start system cre-
ates a desktop launcher. Depending on configuration settings for Java Web Start,
it probably will ask the user's permission to do this first. For more information
on all the capabilities for Java Web Start, go to http://java.sun.com/javase/6/docs/
technotes/guides/javaws/index.html.
Chapter Summary
In this chapter, we covered the steps to create a JavaFX applet and Java Web
Start JavaFX application. We also covered how to interact with the Web page
using the JavaScript to JavaFX bridge. The essence of this is that the JavaFX
applet model has been totally rewritten to be based on Java Web Start. This
allows applets to now take advantage of the caching mechanisms inherent in Java
Web Start, and thus speed up applet startup time. This framework also has built-
in automatic version and update support, so the user always has a current and
consistent set of libraries to ensure reliability. Also, this new framework removes
dependencies on the underlying browser, so now applications can be consistent
across different browser types. Many of the shortcomings of the old applet model
have been fixed.
JavaFX helps abstract out interactions with the underlying framework, so now
applet and Java Web Start deployments are relatively simple and easy. Also,
because both frameworks are based on the same underpinnings, the same JavaFX
code can run, untouched, as a standalone application, a Java Web Start applica-
tion, or a JavaFX applet.
In the next chapter, we will explore an architectural pattern for Web Services,
called Representational State Transfer, commonly known as REST. This will
allow us to take what we have just learned for JavaFX applets and Java Web
Start, and employ them in a full Web Services architecture.
 
Search WWH ::




Custom Search