I. Introduction to Jaws (Java Web Start) Jaws is a new application deployment mechanism that allows you to install what you need by clicking on the link on a web browser installed in the WEB browser. software. It is a transparent processing complex software installation process, which hides software on the local hard drive to execute as fast as possible when needed. Different procedures can stabilize different JDK versions, you can customize the JDK version used by your program. For the client, the JAWS plugin is responsible for downloading the latest JRE (Java Runtime Edition) version when needed. Jaws don't need any special modifications to your program to make your program run on the JAWS mechanism. However, due to the safety of safety, Jaws will put your program in a Sandbox, just like an Applet program, for a digital signature program, customers can choose trust or not trust Your program, if you choose trust, your program can access local resources like local programs (relatively), such as file systems, print systems, etc. Through the Javax.jnlp package, the procedures that are not trusted can only be used for limited system access. Jaws is based on JNLP (Java Network Launching Protocol & API), JNLP is the basic technology that defines the underlying abstraction, JAWS is an implementation. Below, you will find this mechanism by explaining how your Java program is configured. Second, the configuration
The JAWS program is configured with a web server. This is not requested a special web server, any one can, such as IIS, Apache, etc., but you have to modify your web configuration to know Application / X-java-jnlp-file. MIME type. The following is configured in the order of order, the client needs to install the JAWS plugin in advance, is JRE. 1. Packaging JAR files Your program code and data must be packaged into the JAR file, you can create a packaged JAR file through JAR tools provided by JDK1.4, as follows: JAR CVF DRAW_APPLET.JAR DRAW / * .class images / *. GIF assumes that the current directory is D: / javacode / Draw / Classes, this line command will put all extensions in the Draw directory in the current directory as a file in the image of all extensions GIF in the images directory. Packaged into the draw_applet.jar file. Of course, you can also pack your program code or data to multiple JAR files. When your program is very big, there is a significant advantage, that is, all JAR files do not have to be downloaded to the client before the program starts execution. By default, all JAR files are downloaded, but you can configure a special JAR file to download. You can also use DownloadService in the JNLP API to request to download a special JAR file. For programs that need to access client system resources, you need to use another tool Jarsigner provided by JDK to sign it to let users trust your program. 2. Establish a JNLP file JNLP is a JAWS program initial execution location. When the user clicks on a link to the JNLP file, the browser will download this JNLP file first, and the client with jaws will automatically download the program according to the indication of this file and start. In fact, JNLP file is an XML file, and its main function is to list the JAR file resource location of the program. When a JAWS program is first run, you will download all JAR files. When the JAR file on the server changes, the client JAWS program automatically downloads the changed files when the next startup, which makes the client's program to maintain the latest. The program will start directly from the client when there is no change. Below is an example of a JNLP file, this file is saved in my computer d: / javacode / draw / class directory, you can copy and modify to suit your JAWS program:
XML Version = "1.0" encoding = "GBK"?>
3, configure the web server in my system I use apache2. Stop it first, then open the Apache configuration file httpd.conf, find AddType Add the following line: addtype application / x-java-jnlp-file .jnlp My Java code and HTML files used in the D: / javaracode / Draw / Pub directory, you have to add an individual name in the httpd.conf file (called virtual directory in IIS) Point to it: alias / apple "D: / javaracode / DRAW / PUB remote apps webpage h1>