Appendix A.3.1 Typical Configuration

  • The JVM has a single instance of Server.
  • The Server includes a single Connector instance, probably a SelectChannelConnector.
  • The Connector contains 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, and so forth.
  • The ContextHandler may be an instance of WebAppContext which configures itself from the WEB-INF/web.xml file found within the configured ResourceBase and will contain a SessionHandler. The SessionHandler contains a SecurityHandler. The SecurityHandler contains a ServletHandler.
  • The ContextHandler may contain a ServletHandler, which contains the following:
    • FilterHolders
    • FilterMappings
    • ServletHolders
    • ServletMappings

All these components have setters and getters for configuration. These may be configured with the following:

  • Directly calling the API in a java program – see Embedding Jetty
  • Calling the API via Jetty XML – see jetty.xml, jetty-web.xml, jetty-env.xm
  • Calling the bean-style API via a framework such as spring or xbeans – see XBean with Jetty

  • Currently 2.88/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
  Flag Inappropriate Content 0 comments