4.7 Web Application Manifest Processing
Prev | 4. Developing Applications | Next

## 4.7 Web Application Manifest Processing

Virgo Server for Apache Tomcat generates automatic package imports (i.e., via the `Import-Package` manifest header) for certain web applications. This section lists which packages are automatically generated.

VTS supports Web Application Bundles (WABs) as defined by the OSGi Web Applications Specification and WAR files. A WAR will typically not contain any OSGi defined manifest headers. A WAB is distinguished from a WAR by the presence of one or more of the following OSGi defined headers:

- `Bundle-SymbolicName`
- `Bundle-Version`
- `Bundle-ManifestVersion`
- `Import-Package`
- `Web-ContextPath`

As required by the OSGi Web Applications specification, the following defaults are applied to a WAR:

- `Bundle-ManifestVersion` is set to `2`
- `Bundle-SymbolicName` is generated from the path from which the bundle was installed
- `Bundle-ClassPath` is set to `WEB-INF/classes` followed by the JARs in `WEB-INF/lib` in an unspecified order, followed by any transitive dependencies declared by the JARs in `WEB-INF/lib`
- `Import-Package` is extended in an implementation defined way, as described below

The following packages are automatically imported into WARs:

- `javax.servlet;version="2.5"`
- `javax.servlet.http;version="2.5"`
- `javax.servlet.jsp;version="2.1"`
- `javax.servlet.jsp.el;version="2.1"`
- `javax.servlet.jsp.tagext;version="2.1"`
- `javax.el;version="1.0"`

In addition to the above-described imports, VTS will also generate automatic imports for all of the packages that are exported by the system bundle, unless an import for the package already exists in the WAR’s manifest, or the WAR contains the package, i.e. within `WEB-INF/classes`, or in a jar file in `WEB-INF/lib`. When an import is generated, it is versioned such that it exactly matches the version or versions of the package that are exported from the system bundle. For example, a package that’s exported only at version `1.0.0` will generate an import with a version of `[1.0.0,1.0.0]`, and a package that’s exported at version `1.0.0` and version `2.0.0` will generate an import with a version of `[1.0.0,2.0.0]`.

Web Application Bundles are not subject to the above manifest processing. This is a change of behaviour compared to Virgo Web Server 2.1.x. See (see Default Web Application Bundle Headers) if you need the old behaviour until you have changed your WABs to match the new behaviour.

VTS supports ROOT.war as a default web application. The `Web-ContextPath` of the deployed ROOT.war is set to the default web context path - `/`.

| System Bundle Package Exports
For further details on which packages are exported by the OSGi system bundle, consult the `java6-server.profile` file located in the `SERVER_HOME/lib` directory.

Prev | Up | Next
4.6 Programmatic Access to the Servlet Context | Home | 4.8 Working with Dependencies