Web application bundles
A web application bundle (WAB) is a bundle containing a web application and that can be deployed in an OSGi container. A WAB is an OSGi bundle version of a web application archive (WAR) file.
WABs are defined in the OSGi Service Platform Release 4 Version 4.2 Enterprise Specification.
We use a WAB in an OSGi application in much the same way that we use a WAR file in a Java enterprise application. For example, we use a WAB to host servlets, static content, or JavaServer Pages (JSPs) that are part of the application.
A WAB contains a manifest file, META-INF/MANIFEST.MF. This file contains the same minimum set of manifest headers any OSGi bundle manifest contains (for example Bundle-SymbolicName and Bundle-ManifestVersion), and also extra headers specific to WABs. We use these headers to describe the web application in OSGi terms, and to specify the support that we want from the OSGi Applications runtime environment. For example, we do not need to package dependencies inside a WAB; we can instead specify these dependencies in a manifest header and let the runtime environment provision them for you. The only required extra header is Web-ContextPath. We use this header to specify the default context from which the web content is hosted.
An OSGi WAB that uses Servlet 3.0 metadata can contain EJBs. If our WAB contains EJBs, and we use a deployment descriptor XML file to define your EJB metadata, then the file must be located at WEB-INF/ejb-jar.xml. Any IBM binding files must be located in the WEB-INF folder; for example, WEB-INF/ibm-ejb-jar-bnd.xml.
We can convert an enterprise application containing only WAR files to an OSGi application packaged as an enterprise bundle archive (EBA) file. When we import the EBA file as an asset, the WAR files are automatically converted to WABs.
Subtopics
- Considerations for using web applications and bundle fragments in web application bundles
There are a few specifics to consider when you develop a web-enabled OSGi application, especially if the application uses the Servlet 3.0 or Contexts and Dependency Injection (CDI) capabilities of the Java Platform, Enterprise Edition 6 (Java EE 6) specification.
Related:
Enterprise bundle archives Composite bundles Application bundles, use bundles and provision bundles EJB bundles Bundle and package versioning Enterprise OSGi standards Converting a Spring application to an OSGi application OSGi Service Platform Release 4 Version 4.2 Enterprise Specification Converting an enterprise application to an OSGi application Converting a web application archive file to an OSGi web application bundle
File name: was341.html
prettyPrint();