Jetty Configuration
Jetty's primary configuration interface is it's programming API. This is intended to allow Jetty to be embedded in another application without imposing a configuration style. The org.mortbay.http.HttpServer class is the main class for creating and configuring a server.

For non-embedded use, the class org.mortbay.jetty.Server can be used to read an XML configuration file and configure a Jetty Server. The style of this XmlConfiguration is to render the programming API in XML, so objects can be created, methods called and the normal configuration API is used.


Concepts

For an orientation to Jetty configuration:AnnotatedConfigFile

Jetty's uses XML as a rather general bridge between procedural Java and declarative configuration. See XmlConfiguration.

Various configuration settings define sets of URL paths that they apply to. Description of this pattern language is here PathMapping.


Contexts
Jetty groups Servlets and other handlers into Contexts. A Context is a grouping of server resources that share the same URL path prefix, class path and resource base. A Web application is an example of a specific context. Generic contexts may have arbitrary request handlers added to them. All contexts have a path specification and an optional virtual host alias.


Configuring Handlers and Servlets
Web applications have their own standard configuration language. The Jetty XML configuration language together with the APIs for the various Jetty classes define configuration of all parts of Jetty. Here are some "how-to" sections on some common configuration issues:
InitParameters
PreloadServlet
IndexFiles
BasicAuthorization
SslListener
UnixRunScript
LogConfiguration


Specialized Jetty Configurations
Using Jetty with Apache
Jetty, JBoss and Cocoon
Compiling JSPs with Jikes

Return to JettyDoc