Jnlpdownloadservlet guide download




















Java Web Start 1. The packaging support consists of one servlet: JnlpDownloadServlet. The servlet is packaged into the jnlp-servlet. Files : GNUmakefile - the makefile to build the servlet jnlp-servlet. Commands such as cp, echo, mkdir, and rm are required.

The generated classes will go to the classes directory, and the resulting jar files will be in the lib directory by default.

You can adjust the output directory to anything you want by changing the GNUmakefile. About A modified version of the basic jnlp servlet code which is included in the Java 1.

Resources Readme. The servlet has built-in logging capabilities to monitor its behavior. Logging messages are generated in 4 different categories:.

The logging output is controlled by two servlet initialization parameters, logLevel and logPath. The log path specifies a file where the output will be written to.

If no path is specified, logging is done to the standard log for servlets using the ServletContext. For example:. JNLP files will be macro-expanded as described in a section below. A version-based request for a JAR file might result in the generation for an incremental update. The default extension of JNLP files is. These default extensions can be overwritten by the initialization parameters: jnlp-extension and jar-extension.

The MIME type that is returned for a file is also based on its extension. If no mapping is specified, the default MIME types are shown below:. Then the JnlpDownloadServlet will look for the launch.

For example, given the above example, then the WAR file should included the following file:. In general, the timestamp that will be returned for the file is the last-modified timestamp that the file has in the WAR file.

The version-based and extension-based download protocols in the JNLP specification allows a resource to be looked up based on version-id, operating system, system architecture, and locale.

The JnlpDownloadServlet provides two mechanisms for associating this information with a resource. It can be done on a per-file basis, using a naming convention, or by a per-directory basis, using a configuration file. Both methods can be used for the same directory.

The path is specified by the location of the resource in the WAR archive. The rest of the information is either specified by the use of a naming convention or in the version. The filename is parsed according to the BNF notation shown below:.

Only one version-id can be specified per file. However, multiple os, arch, and locale fields can be specified. In each directory, a version. This is an alternative to the file naming convention. A resource can also be specified with a platform version-id in the version. Such a resource is used to match a particular platform request for a JRE.

Platform version requests are generated internally by Java Web Start, when an application has requested a version of the Java platform that is currently not installed on the local system. The complete document type definition DTD for the version. The values of each substitution would be as follows:. The JNLP specification supports requesting application resources with explicit version numbers or resources for certain locales, operating systems, and system architectures. This means that you can deploy an application that has different libraries for different operating systems or different resource files for different locales.

JnlpDownloadServlet provides support for special requests with two different mechanisms. The first is a scheme for naming resource files where locales, operating systems, and other parameters are embedded in the file name. The second mechanism involves an XML file that describes the parameters of resource files in the same directory. JnlpDownloadServlet enables you to specify information about files by embedding it in a file name. If the file name contains two underscores in a row, the file name is treated as containing attributes.

A prefix letter specifies the attribute information, as shown here:. Only one version is allowed per file, but a file can be associated with multiple operating system, architecture, or locale attributes. Note how the actual file name in your web application gets remapped to be visible to the client as app-lib. The file naming convention can be cumbersome, especially if you have multiple resource files that each have multiple associations for operating systems, architectures, or locales.

JnlpDownloadServlet supports an alternate mechanism, where all attributes are described in a separate XML file. The servlet looks for a version. The version. For example, the following version. The app3 example shows how to respond to a versioned request for a resource using the XML version file.

In particular, the JNLP file contains this resource line:. The WAR file contains the library, app-lib. Note how the actual name of the file, app-lib If the current-version-id parameter is included in the request, and the servlet can find both a match on the current-version-id and the requested version, and the request is for a JAR file, then a JARDiff file is generated by the servlet.

The JARDiff file is returned if its size is less than that of the requested version. The JARDiff file is generated and stored in a temporary directory that is specific to the web container. The servlet finds the temporary working directory using the javax. Pack is an efficient compression technology for JAR files. Download and installation times for applications are important factors in how users perceive applications.

Making your application resources as small as possible reduces the amount of time users must wait for your application to download.



0コメント

  • 1000 / 1000