Jetty has moved!
Jetty is a project at the Eclipse Foundation.
Homepage:http://www.eclipse.org/jetty
Downloads: http://download.eclipse.org/jetty/
Documentation:http://www.eclipse.org/jetty/documentation/current/
About:http://www.eclipse.org/jetty/about.php
Jetty Powered:http://www.eclipse.org/jetty/powered/
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

How do I configure Jetty?

Overview

A Jetty is configured by dependency injection into the Jetty components. The root component of Jetty is Server, on which you can set an array of Connector instances and an array of Handler instances. Each specific type of connector and handler will have it's own setters and getters for configuration.

A Typical Configuration

  • The JVM will have a single instance of Server
  • The Server will have a single Connector instance, probably a SelectChannelConnector.
  • The Connector will have a port set on it.
  • The Server will have one or more handlers. Typically these will be instances of ContextHandler that wrap other Handler instances for a given context path.
  • The ContextHandler will be configured with a contextPath and wrapped handler for the context.
  • The ContextHandler may be configured with ResourceBase, ClassLoader, VirtualHosts, etc.
  • The ContextHandler may be an instance of WebAppContext which configures itself from the WEB-INF/web.xml file found within the configured ResourceBase. A WebAppContext will contain:
    • a SessionHander which will contain a
      • a SecurityHandler, which will container a
        • ServletHandler

XML

All container setup, such as ports to listen on, webapps to deploy, thread pools, security etc is done in a jetty configuration file in xml format. An example of such a file is provided in the distribution as etc/jetty.xml. For more information on this file, see the FAQ entry jetty.xml

Additional configuration can be performed on a per webapp basis in a file called jetty-web.xml file placed inside the WEB-INF directory of the webapp. See also jetty-web.xml

FAQ
Back to FAQ


  • No labels
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery