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:58:06 UTC

svn commit: r1094882 - in /karaf/branches/karaf-2.2.x/manual/src/main/webapp/users-guide: http.conf index.conf

Author: jbonofre
Date: Tue Apr 19 06:58:06 2011
New Revision: 1094882

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

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

Added: karaf/branches/karaf-2.2.x/manual/src/main/webapp/users-guide/http.conf
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/manual/src/main/webapp/users-guide/http.conf?rev=1094882&view=auto
==============================================================================
--- karaf/branches/karaf-2.2.x/manual/src/main/webapp/users-guide/http.conf (added)
+++ karaf/branches/karaf-2.2.x/manual/src/main/webapp/users-guide/http.conf Tue Apr 19 06:58:06 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/branches/karaf-2.2.x/manual/src/main/webapp/users-guide/index.conf
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/manual/src/main/webapp/users-guide/index.conf?rev=1094882&r1=1094881&r2=1094882&view=diff
==============================================================================
--- karaf/branches/karaf-2.2.x/manual/src/main/webapp/users-guide/index.conf (original)
+++ karaf/branches/karaf-2.2.x/manual/src/main/webapp/users-guide/index.conf Tue Apr 19 06:58:06 2011
@@ -1,20 +1,21 @@
 h1. Karaf Users Guide
 
-* [Installing Karaf|installation]
-* [Directory Structure|directory-structure]
-* [Starting and stopping Karaf|start-stop]
-* [Using the console|using-console]
-* [Service Wrapper|wrapper]
-* [Web console|web-console]
-* [Remote console|remote-console]
-* [Child instances|child-instances]
-* [Security|security]
-* [Failover Deployments|failover]
-* [Logging system|logging-system]
+* [Installing Karaf|/users-guide/installation]
+* [Directory Structure|/users-guide/directory-structure]
+* [Starting and stopping Karaf|/users-guide/start-stop]
+* [Using the console|/users-guide/using-console]
+* [Service Wrapper|/users-guide/wrapper]
+* [Web console|/users-guide/web-console]
+* [Remote console|/users-guide/remote-console]
+* [Child instances|/users-guide/child-instances]
+* [Security|/users-guide/security]
+* [Failover Deployments|/users-guide/failover]
+* [Logging system|/users-guide/logging-system]
 * [Deployer|/users-guide/deployer]
+* [Provisioning|/users-guide/provisioning]
 * [Karaf Archive|/users-guide/kar]
-* [Provisioning|provisioning]
-* [Configuration|configuration]
+* [Configuration|/users-guide/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]