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 3 Next »

The RewriteHandler is inspired by the Apache's mod-rewrite. Aside from rewriting URI's it can do many things. See the rule list for more.

Rule list

The Rule is divided in 3 types: PatternRule, RegexRule and others. Each rules have a specific actions. And these actions are only invoked whenever the rule find its match. Below are the list of rules with their corresponding actions.

A. PatternRule
This rule uses servlet-mapping syntax for pattern matching. Below are known subclasses of PatternRule.

  1. CookiePatternRule
    Adds a new cookie in response.
  2. HeaderPatternRule
    Add/modifies the HTTP headers in response.
  3. RedirectPatternRule
    Sets the redirect location.
  4. ResponsePatternRule
    Sets the status and error codes.
  5. RewritePatternRule
    Rewrites the requested URI.

B. RegexRule
This rule uses the regular expression syntax for pattern matching. Below are known subclasses of RegexRule.

  1. RewriteRegexRule
    Rewrites the requested URI using regular expression.

C. Others

  1. MSIESSLRule
    Disables the keep alive on SSL from IE5 or IE6.
  2. LegacyRule
    The old version of rewrite.

Sample Configuration

Below is a sample how to configure the rewrite handler in 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