Chapter 12. Deploying a WAR
web.xmlfile in the bundle signals to the container that the bundle should be deployed as a Web application.
12.1. Converting the WAR Using the war Scheme
warscheme has the following basic syntax:
file:URL). Options can be appended to the URL in the following format:
warURL appears in an XML file:
warfeature is required to convert and deploy WARs using the war: scheme. It can be installed from the container's command console using
Deploying a WAR file
osgi:installcommand, taking a
war:mvn:URL as its argument. For example, to deploy the wicket-example WAR file from a Maven repository, where the application should be accessible from the
wicketWeb application context, enter the following console command:
JBossFuse:karaf@root> install war:mvn:org.apache.wicket/wicket-examples/1.4.7/war?Web-ContextPath=wicket
war:file:URL. For example, to deploy the WAR file,
wicket-example-1.4.6.war, enter the following console command:
JBossFuse:karaf@root> install war:file://wicket-examples-1.4.7.war?Web-ContextPath=wicket
Accessing the Web application
Web-ContextPathoption. For example, the
wicket-exampleWAR deployed in the preceding examples, would be accessible from the following URL:
Default conversion parameters
Web-ContextPathManifest header). By default, the deployed WAR is configured as an isolated bundle (neither importing nor exporting any packages). This mimics the deployment model of a WAR inside a J2EE container, where the WAR is completely self-contained, including all of the JAR files it needs.
Customizing the conversion parameters
Bundle-ClassPath, because the default value of
Bundle-ClassPathdoes not include all of the resources in the WAR file (see Table A.2, “Default Instructions for Wrapping a WAR File”).
web.xmlfile, automatically deploys the WAR in a Web container. The War Protocol page has the original reference documentation for the War URL handler.