WAR Extender FAQ


Is the order the bundles are installed / started important?

No. Http service (Pax Web), war extender or your war bundle(s) can be installed / uninstalled / started / stopped in any order. Everything will function as you expect.

What will happen if I stop / uninstall my war?

All the registered elements for the web application corresponding to the stopped war (servlet context, servlets, resources, filters, listeners) will be unregistered.

What if I restart it? Or update it?

A new web application corresponding to your war will be registered.

What happens if I stop / uninstall the http service?

All deployed web applications will be unregistered.

What if I restart it?

New web applications will be registered for all deployed wars.

What happens if I stop / uninstall the pax war extender?

All deployed web applications will be unregistered.

What if I restart it?

New web applications will be registered for all deployed wars.

I have a standard war. Can I deploy it into an OSGi framework?

Yes, read about how you can do that.

I do not want / can change the war. Can I still deploy it?

Yes, you can do that in a static or dynamic way.

Now that I deployed my war, how can I get a service from OSGi Service Registry?

A deployed war is as any OSGi bundle. A bundle accesses the OSGi framework's services through the bundle's BundleContext. To enable a web application to access its BundleContext you must develop a BundleActivator and add the Bundle-Activator manifest header. This BundleActivator should store the BundleContext in a location that is accessible by the application's servlets, filters or listeners. You can achieve this by using a static field/method set by your BundleActivator or store it in a ServletContext attribute.

My application uses JSPs. Are them supported?

Yes, JSPs are supported via Pax Web Extensions. Take a look at how you can enable JSP support.

Is there any example?

Yes, there are two examples: Wicket and Spring Petclinic.

How can I set the servlet context path?

Pax Web War extender will use as servlet path by default the symbolic name of the bundle. If you want to change that you can set the Webapp-Context manifest attribute to the name you want. This attribute should be set into the manifest (MANIFEST.MF) of the bundle that contains the web app (same bundle as the one containing the web.xml file). For example:

Web-ContextPath: myApp

Content