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
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.
- CookiePatternRule
Adds a new cookie in response. - HeaderPatternRule
Add/modifies the HTTP headers in response. - RedirectPatternRule
Sets the redirect location. - ResponsePatternRule
Sets the status and error codes. - RewritePatternRule
Rewrites the requested URI.
B. RegexRule
This rule uses the regular expression syntax for pattern matching. Below are known subclasses of RegexRule.
- RewriteRegexRule
Rewrites the requested URI using regular expression.
C. Others
- MSIESSLRule
Disables the keep alive on SSL from IE5 or IE6. - LegacyRule
The old version of rewrite.
Sample Configuration
Below is a sample how to configure the rewrite handler in jetty-rewrite.xml.
To use this configuration, include the configuration file during jetty startup. Example below.