Configuring Jetty
Overview
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
Serverwill have a singleConnectorinstance, probably a SelectChannelConnector. - The
Connectorwill have a port set on it. - The
Serverwill have one or more handlers. Typically these will be instances of ContextHandler that wrap other Handler instances for a given context path. - The
ContextHandlerwill be configured with a contextPath and wrapped handler for the context. - The
ContextHandlermay be configured with ResourceBase, ClassLoader, VirtualHosts, etc. - The
ContextHandlermay be an instance of WebAppContext which configures itself from theWEB-INF/web.xml file found within the configured ResourceBase and will contain a SessionHandler, which will contain a SecurityHandler, which will container a ServletHandler - The
ContextHandlermay contain aServletHandler, which will contain:
...