In order for RectangleArea.jar to be treated as a download extension, RectangleArea.jar must be listed in the Class-Path header in AreaApplet.jar's manifest. To see how that's done, let's assume that you've bundled AreaApplet in a JAR file called AreaApplet.jar and that the class RectangleArea is bundled in RectangleArea.jar. One way around that problem is to make the RectangleArea class available from the server side, and you can do that by using it as a download extension. However, you can't assume that everyone who downloads and uses your applet is going to have the RectangleArea class available on their system, as an installed extension or otherwise. This applet instantiates a 10 x 5 rectangle and then displays the rectangle's area by using the RectangleArea.area method. Assume for example that a.jar and b.jar are two JAR files in the same directory, and that the manifest of a.jar contains this header: Since download extensions that use the Class-Path headers are simpler, let's consider them first. But, as shown later in this tutorial, they are more complex to deploy. Their advantage is that they are downloaded the first time they're needed subsequently they can be used without downloading. Download extensions that are downloaded by an Extension-List header are installed into the /lib/ext directory of the JRE that downloads them. Their advantage is that nothing is installed on the client their disadvantage is that they are downloaded each time they are needed. ![]() Download extensions indicated by a Class-Path header are downloaded only for the lifetime of the application that downloads them, such as a web browser. Note that at most one of each is allowed in a manifest. The extensions can be referenced in one of two ways: A JAR file's manifest can contain headers that refer to one or more download extensions. Download extensions are sets of classes (and related resources) in JAR files.
0 Comments
Leave a Reply. |