Version: 9.4.7.v20170914 |

Chapter 18. Provided Servlets, Filters, and Handlers
Previous | Part III. Jetty Administration Guide Home | Next

##### 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 for sponsored feature development

## Chapter 18. Provided Servlets, Filters, and Handlers

Jetty ships with a bundle of servlets that interact with the key classes. Most are in the org.eclipse.jetty.servlets package. These servlets and filters are among the principle elements of Jetty as a component-based infrastructure that holds and runs J2EE applications. As described, they play a major role in running and maintaining the Jetty server.

Also included are a number of Jetty specific handlers that allow access to internals of jetty that would not normally be exposed and are very useful testing environments and many production scenarios.

## Default Servlet

### Info

- Classname: `org.eclipse.jetty.servlet.DefaultServlet`
- Maven Artifact: org.eclipse.jetty:jetty-servlet
- Javadoc: http://www.eclipse.org/jetty/javadoc/9.4.7.v20170914/org/eclipse/jetty/servlet/DefaultServlet.html

### Usage

The `DefaultServlet` implements the `ResourceFactory` interface and extends the `HttpServlet` abstract class. It is usually mapped to "/" and provides handling for static content, `OPTION` and `TRACE` methods for the context. The `MOVE` method is allowed if `PUT` and `DELETE` are allowed. See the `DefaultServlet` javadoc.

### Init Parameters

Jetty supports the following `initParameters`:

acceptRanges
  If true, range requests and responses are supported.
dirAllowed
  If true, directory listings are returned if no welcome file is found. Otherwise 403 Forbidden displays.
redirectWelcome
  If true, welcome files are redirected rather that forwarded.
gzip
  If set to true, then static content is served as gzip content encoded if a matching resource is found ending with ".gz".
resourceBase
  Set to replace the context resource base.
aliases
  If true, aliases of resources are allowed (that is, symbolic links and caps variations) and may bypass security constraints.
maxCacheSize
  Maximum total size of the cache or 0 for no cache.
maxCachedFileSize
  Maximum size of a file to cache.
maxCachedFiles
  Maximum number of files to cache.
useFileMappedBuffer
  If set to true, mapped file buffer serves static content. Setting this value to false means that a direct buffer is used instead of a mapped file buffer. By default, this is set to true.
otherGzipFileExtensions
  A comma separated list of other file extensions that signify that a file is gzip compressed. If you don’t explicitly set this, it defaults to ".svgz".

Previous | Top | Next
Configuring Jetty for FastCGI | Home | Proxy Servlet

See an error or something missing? Contribute to this documentation at Github!(Generated: 2017-09-14)