Book Image

Apache Karaf Cookbook

By : Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler
Book Image

Apache Karaf Cookbook

By: Jamie Goodyear, Johan Edstorm, Achim Nierbeck, Heath J Kesler

Overview of this book

Table of Contents (17 chapters)
Apache Karaf Cookbook
About the Authors
About the Reviewers

Configuring Pax Web modules deployed in Apache Karaf

Pax Web uses Jetty as the underlying web container. The OSGi Http Service specification defines a set of parameters for configuration of the Http Service. In addition to these standard configuration parameters, the Pax Web-specific parameters are configurable. On top of those configuration parameters, it's also possible to configure Jetty itself for further needs.

How to do it…

The configuration of the Http Service is done through the Configuration Admin service. During the installation of the Http Service, the configuration is also set for the service PID org.ops4j.pax.web, as shown in the following code snippet:

javax.servlet.context.tempdir = ${}/pax-web-jsp
org.ops4j.pax.web.config.file = ${karaf.home}/etc/jetty.xml
org.osgi.service.http.port = 8181

How it works…

This basic set of configuration defines the HTTP port the Jetty server is listening to, the servlet temp directory to create JSP servlet files, and the location of the...