Jetty Java HTTP Servlet Server
Jetty is an Open Source
HTTP Servlet Server written in 100% Java. It is both a full featured
HTTP/1.1 server and a servlet container.
It is designed to be full featured, light weight, high performance, embeddable,
extensible and flexible, thus making it an ideal platform for serving
dynamic HTTP requests from or for any Java application.
100% Java Server
Jetty is a 100% Java HTTP Server and Servlet Container. Unlike separate server/container solutions, this means that your web server and web application run in the same process, without interconnection overheads and complications. Furthermore, as a pure java component, Jetty can be simply included in your java application and is available on all your Java platforms.
Open Source License
Jetty is released under an Open Source
License, derived from the Artistic License. Full source code is included in
the release. The License puts few restrictions on usage of Jetty. Jetty is free for commercial use and distribution.
HTTP/1.1 Protocol
Jetty supports the HTTP/1.0 and HTTP/1.1 protocols. The 1.1 protocol offers
much greater network performance. Furthermore, as the HTTP server and the
Servlet container and in the same JVM, this gives simpler configuration,
much greater performance and full access to all server resources from
within servlets.
Serving Servlets
Jetty supports the javax.servlet. API defined by
JavaSoft:
Servlets are protocol- and platform-independent server side components,
written in Java, which dynamically extend Java-enabled
servers. They provide a general framework for services built using the
request-response paradigm. [Javasoft's Java Servlet API White Paper]
Jetty 2 uses the 2.1 Servlet API and Jetty 3 uses the 2.2 Servlet API.
Java Server Pages
Jetty includes a JSP package, which implements Java Server Pages, a method
for adding dynamic content to HTML pages. Currently this is the Jasper JSP
engine from apache.
SSL Support
Jetty has a SunJsseListener which uses Sun's JSSE reference implementation to provide support for HTTPS. It is even possible to use the same pair of public/private keys as a pre-existing apache server by using the KeyPairTool to load the private key and its certificate into a keystore for JSSE.
If the use of a commercial SSL implementation is required, FORGE have contributed a listener which allows their Protekt product to be used as an SSL provider. A similar approach may be used to integrate other SSL implementations.
Modular Architecture
Jetty request handling is based on collections of abstracted request listeners
and handlers. All Jetty features are provided by specializations of these
abstract components. This allows Jetty's behaviour to be extended and/or
enhanced by the addition of extra listeners and handlers.
The Jetty3Extra repository contains extension such as
JMX configuration and SASL authentication.
Embeddable
For many applications, HTTP is just another interface protocol. Jetty can
easily be embedded in such applications and products without adopting a
WWW centric application architecture. A good example of this style of usage
is in a distributed system, where each process runs it's own Jetty server
in order to present a managment and monitoring Web interface.
Small & Efficient
Jetty has been optimized by commercial and experimental use since 1995 and
a small and efficient server is the result:
- A HTTP server can be configured in a jar file under 200KB.
- Jetty consistently benchmarks as one of the fastest servlet servers.
- Jetty servers scale well to thousands of simultaneous connections
- Server performance degrades gracefully under stress.
Flexible Configuration
Jetty has been designed to highly configurable and flexible. It can be used
as a stand-alone server running application servlets or it can be embedded
in java application to provide a WWW interface to the services that they
provide. The configuration of a server is controlled by:
- J2EE deployment descriptors.
- Direct API calls.
- XML configuration.
HTML Generation
While HTML is a simple language to learn and write, it can be also be
very tedious, contrived and error prone. Furthermore, authored HTML
is a static resource and cannot be customized to each request or updated
from a database.
Jetty comes with a rich HTML generation package that can be used on its
own, with another servlet server or in Jetty servlets. Supported for
templated look and feel is a key element of this package.
EJB Integration
Jetty has been instrumented as JMX model MBeans which allows it
to be seamlessly integrated into the JBoss EJB
application server. This gives a complete J2EE container with
HTTP, Servlets, JSPs and EJBs all within a single JVM.