Jetty is an open-source, standards-based, full-featured web server
implemented entirely in Java. It is released under the Apache 2.0
licence
and is therefore free for
commercial use and distribution. First created in 1995, Jetty has
benefitted from input from a vast user community and consistent and
focused development by a stable core of lead developers. There are many
more examples of Jetty in action on the Jetty Powered Page
that has selections from among the tens of thousands of production Jetty instances. However, as
Jetty aims to be as unobtrusive as possible, countless websites and
products are based around Jetty, but Jetty is invisible!
Full commercial support, training and development services for Jetty
and Jetty-based projects are available from Webtide
.
Jetty can be used as:
a stand-alone traditional web server for static and dynamic content
a dynamic content server behind a dedicated HTTP server such as Apache using mod_proxy
an embedded component within a java application
This flexibility means that Jetty can be encountered in a number of different contexts:
shipped with products to provide out-of-the-box useability eg Tapestry
, Liferay
distributed on CDs with books to make examples and exercises ready-to-run
incorporated into applications as a HTTP transport eg JXTA
, MX4J
The guiding principle of Jetty could be said to be "simplicity not complexity". We want to make Jetty easy to understand and use:
Configuration is either by API or by xml file
Xml file syntax is a straightforward mapping from the API operating on POJOs
Default configuration files make Jetty useable out-of-the-box
Minimal number of lines required to embed a Jetty instance
Scalability
In asynchronous Web 2.0 type applications using techniques such as AJAX,
connections stay open longer than when serving static pages, and thread
and memory requirements can escalate drastically. Infrastructure must
handle that gracefully lest an individual component, such as a slow
database connection stop an entire site because of a lack of threads.
With Jetty...
Performance degrades gracefully under stress for high quality of service
Working Within the framework of existing web specificiations, handle large user loads and long-lived sessions with continuations
Integrations available to clustering options such as WADI
and Terracotta
Efficiency
A lot of effort goes into optimizing Jetty's performance and crafting the code so as to make the footprint as small as possible:
Dependencies are kept to the absolute minimum
The core is kept small with extra functionality in optional jars
Scalability is a key concern
Performance degrades gracefully under stress
Embeddability
Jetty is designed to be a good component. This means that it can easily be embedded in an application without forcing the application to adapt to it:
Usage of dependency injection and inversion of control patterns
Pluggability
Jetty is architected for pluggability. The API allows different implementations of all of the principal Jetty components to be selected. At least one, but sometimes more, implementations of a component are always provided. However if these do not meet your needs, you are free to code your own using the interfaces and abstract classes as a basis. This means that Jetty can be easily customised to a particular application environment. This is particularly useful when Jetty is acting as the web container in a JavaEE server, as Jetty's pluggability ensures a tight integration with a host container.