Java Reference
In-Depth Information
Some tags have an opening tag only, such as line 11:
<offline-allowed/>
The offline-allowed tag indicates that the application can be run even if the user is not
connected to the Internet. If it was omitted from the JNLP file, the opposite would be
true, and the user would be forced to go online before running this application.
In XML, all tags that do not have a closing tag end with /> instead of > .
Tags also can have attributes, which are another way to define information in an XML
file. An attribute is a name inside a tag that is followed by an equal sign and some text
within quotes.
For example, consider line 9 of Listing 14.1:
<homepage href=”http://www.java21days.com”/>
This is the homepage tag, and it has one attribute, href . The text between the quote
marks is used to set the value of this attribute to http://www.java21days.com. This
defines the home page of the application—the web page that users should visit if they
want to read more information about the program and how it works.
The PageData JNLP file defines a simple Java Web Start application that runs with no
security restrictions, as defined in lines 17-19:
<security>
<all-permissions/>
</security>
In addition to the tags that have already been described, Listing 14.1 defines other infor-
mation required by Java Web Start.
Line 1 designates that the file uses XML and the UTF-8 character set. This same line can
be used on any of the JNLP files you create for applications.
Line 2 is a comment. Like other comments in Java, it's placed in the file solely for the
benefit of humans. Java Web Start ignores it.
The jnlp element, which begins on line 3 and ends on line 21, must surround all the
other tags that configure Web Start.
This tag has two attributes, codebase and href , which indicate where the JNLP file for
this application can be found. The codebase attribute is the uniform resource locator
(URL) of the folder that contains the JNLP file. The href attribute is the name of the file
or a relative URL that includes a folder and the name (such as “pub/PageData.jnlp” ).
Search WWH ::




Custom Search