You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2011/04/19 08:52:13 UTC

svn commit: r1094881 - in /karaf/trunk/manual/src/main/webapp/users-guide: http.conf index.conf

Author: jbonofre
Date: Tue Apr 19 06:52:13 2011
New Revision: 1094881

URL: http://svn.apache.org/viewvc?rev=1094881&view=rev
Log:
[KARAF-463] Add user guide manual section about Pax Web and OSGi HTTP Service.

Added:
    karaf/trunk/manual/src/main/webapp/users-guide/http.conf
Modified:
    karaf/trunk/manual/src/main/webapp/users-guide/index.conf

Added: karaf/trunk/manual/src/main/webapp/users-guide/http.conf
URL: http://svn.apache.org/viewvc/karaf/trunk/manual/src/main/webapp/users-guide/http.conf?rev=1094881&view=auto
==============================================================================
--- karaf/trunk/manual/src/main/webapp/users-guide/http.conf (added)
+++ karaf/trunk/manual/src/main/webapp/users-guide/http.conf Tue Apr 19 06:52:13 2011
@@ -0,0 +1,54 @@
+h1. Pax Web (OSGi HttpService)
+
+The Karaf http feature enables the Pax Web implementation of the OSGi HTTP service.
+
+h2. Installing the HTTP feature
+
+{code}
+root@karaf> features:install http
+{code}
+
+Create a file {{etc/org.ops4j.pax.web.cfg}} with the following content:
+
+{code}
+org.osgi.service.http.port=8080
+{code}
+
+This tells Pax Web to listen to the port 8080. As soon as the http feature is installed and the config
+file is present, the following URL will be reachable:
+
+{code}
+http://localhost:8080/
+{code}
+
+h2. Registering a servlet with the HttpService manually
+
+See [Apache Felix HTTP Service|http://felix.apache.org/site/apache-felix-http-service.html].
+
+h2. Using the Pax Web whiteboard extender
+
+The Pax Web whiteboard extender is part of the war feature. So use the following command to install:
+
+{code}
+root@karaf> features:install war
+{code}
+
+The [Pax Web whiteboard|http://wiki.ops4j.org/display/ops4j/Pax+Web+Extender+-+Whiteboard] extender listens to services
+of interface type HttpServlet and Filter.
+It will register each of these interfaces with the HttpService and remove them as soon as the service goes down.
+So it is much more convenient than registering with the HttpService directly.
+
+{code}
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+    <service interface="javax.servlet.http.HttpServlet">
+        <service-properties>
+            <entry key="alias" value="/myservlet"/>
+        </service-properties>
+        <bean id="myServlet" class="com.example.MyServlet"/>
+    </service>
+</blueprint>
+{code}
+
+The above snippet publishes the Servlet MyServlet on http://localhost:8080/myServlet.
+
+Please keep in mind that the Whiteboard pattern for Servlets is not standardized and only works with Pax Web.
\ No newline at end of file

Modified: karaf/trunk/manual/src/main/webapp/users-guide/index.conf
URL: http://svn.apache.org/viewvc/karaf/trunk/manual/src/main/webapp/users-guide/index.conf?rev=1094881&r1=1094880&r2=1094881&view=diff
==============================================================================
--- karaf/trunk/manual/src/main/webapp/users-guide/index.conf (original)
+++ karaf/trunk/manual/src/main/webapp/users-guide/index.conf Tue Apr 19 06:52:13 2011
@@ -15,6 +15,7 @@ h1. Karaf Users Guide
 * [Provisioning|provisioning]
 * [Karaf Archive|kar]
 * [Configuration|configuration]
+* [Pax Web (OSGi HttpService)|/users-guide/http]
 * [Web applications|/users-guide/web-applications]
 * [OS integration|/users-guide/wrapper]
 * [JRE packages tuning|/users-guide/jre-tuning]