Jetty has moved!
Jetty is a project at the Eclipse Foundation.
Homepage:http://www.eclipse.org/jetty
Downloads: http://download.eclipse.org/jetty/
Documentation:http://www.eclipse.org/jetty/documentation/current/
About:http://www.eclipse.org/jetty/about.php
Jetty Powered:http://www.eclipse.org/jetty/powered/
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
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

The RewriteHandler takes a list of rules and evaluates each rule to determine whether to apply it or not. It is inspired by Apache's mod-rewrite, but can do many things aside from rewriting URIs. See the rule list below for information about individual rules included with Jetty.

Rule List

A. PatternRule

Abstract rule to use as a base class for rules that use a PathMap for pattern matching. It uses the servlet pattern syntax. Below are known subclasses of PatternRule, and descriptions of their actions:

  1. CookiePatternRule
    Adds a cookie to the response.
  2. HeaderPatternRule
    Adds/modifies a header in the response.
  3. RedirectPatternRule
    Redirects the response.
  4. ResponsePatternRule
    Sends the response code (status or error).
  5. RewritePatternRule
    Rewrite the URI by replacing the matched request path with a fixed string.

B. RegexRule

Abstract rule to use as a base class for rules that match with a regular expression. Below are known subclasses of RegexRule, and descriptions of their actions:

  1. RewriteRegexRule
    Rewrite the URI by matching with a regular expression. (The replacement string may use $n to replace the nth capture group.)

C. Others

  1. MsieSslRule
    Disables the keep alive for SSL from IE5 or IE6.
  2. LegacyRule
    Rule implementing the legacy API of RewriteHandler

Sample Configuration

Below is a sample configuration for jetty-rewrite.xml.

jetty-rewrite.xml

To use this configuration, include the configuration file during jetty startup. Example below.

  • No labels
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