Jetty Logo
Version: 9.2.7-SNAPSHOT
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 from 1 day to full product delivery

Resource Handler

Info
Usage
Improving the Look and Feel
Embedded Example

Info

Usage

This handler will serve static content and handle If-Modified-Since headers and is suitable for simple serving of static content.

Important

There is no caching done with this handler so if you are looking for a more featureful way of serving static content look to the Default Servlet.

Note

Requests for resources that do not exist are let pass (Eg no 404's).

Improving the Look and Feel

The resource handler has a default stylesheet which you can change by calling setStyleSheet(String location) with the location of a file on the system that it can locate through the resource loading system. The default css is called jetty-dir.css and is located in the jetty-util package, pulled as a classpath resource from the jetty-util jar when requested through the ResourceHandler.

Embedded Example

The following is an example of a split fileserver, able to serve static content from multiple directory locations. Since this handler does not return 404's on content you are able to iteratively try multiple resource handlers to resolve content.

See an error or something missing? Contribute to this documentation at Github!(Generated: 2014-12-21T01:00:27-08:00)