...
contextId
- Id of context to be referenced by a servlet or filter service.
Using the Servlet Bridge
The servlet bridge is used if you want to use the Http service inside a WAR deployed on a 3rd part applicaiton server. A little setup is needed for this to work:
- Deploy
org.apache.felix.http.proxy
jar file inside the web applicaiton (WEB-INF/lib). - In a startup listener (like ServletContextListener) set the BundleContext as a servlet context attribute (see example).
- Define
org.apache.felix.http.proxy.ProxyServlet
inside yourweb.xml
and register it to serve on all requests/*
(see example). - Be sure to add
javax.servlet;javax.servlet.http;version=2.5
to OSGi system packages ((org.osgi.framework.system.packages
). - Deploy
org.apache.felix.http.bridge
(ororg.apache.felix.http.bundle
) inside the OSGi framework.
A detailed example can be found http://svn.apache.org/repos/asf/felix/trunk/http/samples/bridge.
Configuration Properties
The service can both be configured using OSGi environment properties and using Configuration Admin. The service PID for this service is "org.apache.felix.http"
. If you use both methods, Configuration Admin takes precedence. The following properties can be used (some legacy property names still exist but are not documented here on purpose):
...