Show Table of Contents
A.5. War URL Handler
If you need to deploy a WAR file in an OSGi container, you can automatically add the requisite manifest headers to the WAR file by prefixing the WAR URL with
war:, as described here.
A War URL is specified using either of the following syntaxes:
The first syntax, using the
warscheme, specifies a WAR file that is converted into a bundle using the default instructions. The warURL can be any URL that locates a WAR file.
The second syntax, using the
warrefscheme, specifies a Bnd properties file, instructionsURL, that contains the conversion instructions (including some instructions that are specific to this handler). In this syntax, the location of the referenced WAR file does not appear explicitly in the URL. The WAR file is specified instead by the (mandatory)
WAR-URLproperty in the properties file.
Some of the properties in the
.bndinstructions file are specific to the War URL handler, as follows:
- (Mandatory) Specifies the location of the War file that is to be converted into a bundle.
- Specifies the piece of the URL path that is used to access this Web application, after it has been deployed inside the Web container.NoteEarlier versions of PAX Web used the property,
Webapp-Context, which is now deprecated.
By default, the War URL handler adds manifest headers to the WAR's
META-INF/Manifest.mffile as shown in Table A.2, “Default Instructions for Wrapping a WAR File”.
Table A.2. Default Instructions for Wrapping a WAR File
|Manifest Header||Default Value|
|No packages are exported.|
|The name of the WAR file, where any characters not in the set |
|No default value. But the WAR extender will use the value of |
In addition to any class path entries specified explicitly, the following entries are added automatically:
The following War URL locates version 1.4.7 of the
wicket-examplesWAR in a Maven repository and converts it to an OSGi bundle using the default instructions:
The following Wrap URL specifies the
The following War URL converts the WAR file referenced by the
WAR-URLproperty in the
wicket-examples-1.4.7.bndfile and then converts the WAR into an OSGi bundle using the other instructions in the
For more details about the
warURL syntax, see the original Pax URL War Protocol documentation.