The browser-based applications that present the kinds of engrossing user interfaces (UIs) and content previously found only in desktop applications -- otherwise known as Rich Internet Applications (RIAs) -- are becoming increasingly popular with developers, writes Sun Developer Network staffer Ed Ort, in part because of the ubiquity of the Internet and also because of the improved uniformity in the way different browsers handle RIAs.
Ort shows how the Deployment Toolkit (DT) can help ensure that a developer's Java RIAs can be deployed and launched consistently across different types of user environments, as well as how DT's extensive set of JavaScript functions can help developers perform a wide variety of deployment-related tasks — anywhere from determining if DT native components are installed in a user's environment, to triggering the installation of the latest JRE, to generating appropriate tags and then running an applet, to generating a button to launch a Java Web Start application.
"Improved uniformity," Ort continues, does not mean that all RIAs run the same way in all user environments or that they can even be deployed in all user environments. In the case of Java RIAs, or applets and Java Web Start applications, for example, the latter are applications launched by Java Web Start technology. But, if an applet requires the latest version of Java Plug-In software or a specific level of the Java Runtime Environment (JRE), or if a Java Web Start application requires at least a minimum level of Java Web Start software installed, there is a solution, according to Ort. And that solution is the same one that applies in the case of needing to detect whether the user's environment satisfies those requirements? And if the user's environment does not meet those requirements, that same solution enables the actions one can take to ensure that the RIA successfully deploys and runs in those environments.
That solution is the DT, Ort writes, and it can help ensure that Java RIAs can be deployed and launched consistently across different types of user environments.
Ort's article, "Developing RIAs in Mixed Environments," covers some mixed-environment deployment scenarios, such as when a developer might want a Java RIA to successfully deploy and run in multiple types of environments. An example that Ort cites might be the instance when a developer wants an applet to deploy and take advantage of the latest Java Plug-In software if that version of the Java Plug-In software is installed but what is important is determining how the deployed applet cannot take advantage of the latest Java Plug-In features because it is not installed. The answer lies in the DT's ability to successfully deploy and run RIAs in these mixed environments, says Ort.
The contents of the article include:
- The Deployment Toolkit (DT)
- Mixed-Environment Scenarios and Solutions
Ort explains that the DT consists of a JavaScript library, an ActiveX control, and a plugin. The JavaScript library provides JavaScript functions that are designed to ease the deployment of RIAs. The ActiveX control and the plugin augment the capabilities of the JavaScript library. The DT provides a web-based mechanism to detect and, if necessary, install or upgrade the JRE in a user's environment.
Both the ActiveX control and the plugin augment the capabilities of the JavaScript library, and are automatically installed when the JRE is installed Ort points out, adding that the ActiveX control is used when the client browser is Internet Explorer, and the plugin when the client browser is Firefox or another Mozilla family browser.
Without either of these native components, that is, ActiveX control or plugin, the functions in the JavaScript library are nevertheless able to perform their tasks. If the appropriate native component is installed, however, those tasks can be performed in an enhanced way, Ort notes. For example, he proceeds, one of the functions in the JavaScript library, getJREs(), returns the latest version of the JRE installed in the user's environment or the Java family of the latest installed JRE. The Java family is the base level of the JRE. If the user's environment has JRE 1.5.0_05 and 1.5.0_08 installed, for instance, the Java family is 1.5.0. However, with the appropriate native component installed, the function returns a list of all the installed JREs in the user's environment, says Ort.
It is possible to access the DT script, or for a deployment on secure web pages, access to this script is also available. The script exposes a single object, named deployJava, which contains the necessary public functions.
Ort displays all of these public functions in tabular form with an explanation of each one before turning to the section of his article on mixed-environment scenarios and solutions, of which he discusses the following six, with an abundance of code samples:
- Scenario 1: Deploy an applet to JRE 6. Upgrade earlier versions of JRE to JRE 6.
- Scenario 2: Deploy an applet using new plugin2 features of JRE 6 Update 18. Upgrade earlier versions of JRE to JRE 6 Update 18. Deploy a different applet where upgrade is not feasible.
- Scenario 3: Deploy an applet to a JRE in the JRE 5 family using new Java Plug-In software features of JRE 6 Update 10. Upgrade if JRE 6 installed, but less than Update 10.
- Scenario 4: Deploy Java Web Start application to static versioned JRE 5 Update 2. Use new JNLP features in JRE 6 Update 18.
- Scenario 5: Deploy Java Web Start application using new JNLP features if user's environment has JRE 6 Update 18. Otherwise, use earlier release of Java Web Start technology. Install JRE if user does not have Java Web Start technology installed.
- Scenario 6: Deploy an applet in Windows and Mac OS. In Windows environments that have plugin2 installed, deploy the applet using JNLP. Otherwise, generate an <applet> tag to deploy the applet. The applet requires JRE 5 or later.
More Information
Deployment Toolkit - The Java Tutorials
"Java Rich Internet Applications Deployment Advice" - Sun Developer Network article
Deployment - The Java Tutorials
JavaFX Preview
[...read more...]
Other articles in the Developer section of Volume 145, Issue 2:
Use the Deployment Toolkit for Successful Applet Launches Across Mixed Environments
(this article)
See all archived articles in the Developer section.
|
|
Top 10 Most Popular Articles in Current Issue (Vol 168, Issue 1)
|
|
|
|
|