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

The RewriteHandler is responsible for rewriting URI's of received requests. Each requests will go through to the list of rules you have specified either in configuration or pragmatically. If a rule finds a match with the requests, the rule will apply its action.

Rule list

The Rule is divided in two types: PatternRule and RegexRule. Each rules have a specific actions. And these actions are only invoked whenever the rule find its match. Here are the list of rules and 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. MSIESSLRule
  1. RewriteRegexRule

Sample Configuration

Below is a sample how to configure the rewrite handler in jetty.xml.

jetty.xml
  • 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