org.mortbay.jetty.handler.rewrite
public class RuleContainer extends Rule
Modifier and Type | Field and Description |
---|---|
protected boolean |
_handled |
protected LegacyRule |
_legacy |
protected java.lang.String |
_originalPathAttribute |
protected boolean |
_rewritePathInfo |
protected boolean |
_rewriteRequestURI |
protected Rule[] |
_rules |
_handling, _terminating
Constructor and Description |
---|
RuleContainer() |
Modifier and Type | Method and Description |
---|---|
void |
addRewriteRule(java.lang.String pattern,
java.lang.String prefix)
Deprecated.
|
void |
addRule(Rule rule)
Add a Rule
|
protected java.lang.String |
apply(java.lang.String target,
HttpServletRequest request,
HttpServletResponse response)
Process the contained rules (called by matchAndApply)
|
java.lang.String |
getOriginalPathAttribute() |
org.mortbay.jetty.servlet.PathMap |
getRewrite()
Deprecated.
|
Rule[] |
getRules()
Returns the list of rules.
|
boolean |
isHandled()
Deprecated.
not thread safe, better to rely on baseRequest.isHandled()
|
boolean |
isRewritePathInfo() |
boolean |
isRewriteRequestURI() |
java.lang.String |
matchAndApply(java.lang.String target,
HttpServletRequest request,
HttpServletResponse response)
Process the contained rules
|
void |
setHandled(boolean handled)
Deprecated.
best to use the baseRequest.isHandled()
|
void |
setLegacyRule(LegacyRule legacyRule)
To enable configuration from jetty.xml on rewriteRequestURI, rewritePathInfo and
originalPathAttribute
|
void |
setOriginalPathAttribute(java.lang.String originalPathAttribte) |
void |
setRewrite(org.mortbay.jetty.servlet.PathMap rewrite)
Deprecated.
|
void |
setRewritePathInfo(boolean rewritePathInfo) |
void |
setRewriteRequestURI(boolean rewriteRequestURI) |
void |
setRules(Rule[] rules)
Assigns the rules to process.
|
isHandling, isTerminating, setHandling, setTerminating, toString
protected Rule[] _rules
protected boolean _handled
protected java.lang.String _originalPathAttribute
protected boolean _rewriteRequestURI
protected boolean _rewritePathInfo
protected LegacyRule _legacy
public void setLegacyRule(LegacyRule legacyRule)
legacyRule
- old style rewrite rulepublic void setRules(Rule[] rules)
rules
- an array of Rule
.public void addRule(Rule rule)
rule
- The rule to add to the end of the rules arraypublic boolean isRewriteRequestURI()
HttpServletRequest.getRequestURI()
.public void setRewriteRequestURI(boolean rewriteRequestURI)
rewriteRequestURI
- true if this handler will rewrite the value
returned by HttpServletRequest.getRequestURI()
.public boolean isRewritePathInfo()
HttpServletRequest.getPathInfo()
.public void setRewritePathInfo(boolean rewritePathInfo)
rewritePathInfo
- true if this handler will rewrite the value
returned by HttpServletRequest.getPathInfo()
.public java.lang.String getOriginalPathAttribute()
public void setOriginalPathAttribute(java.lang.String originalPathAttribte)
originalPathAttribte
- If non null, this string will be used
as the attribute name to store the original request path.public org.mortbay.jetty.servlet.PathMap getRewrite()
public void setRewrite(org.mortbay.jetty.servlet.PathMap rewrite)
public void addRewriteRule(java.lang.String pattern, java.lang.String prefix)
public boolean isHandled()
http://jira.codehaus.org/browse/JETTY-1287
public void setHandled(boolean handled)
handled
- true if one of the rules within the rule container is handling the requestpublic java.lang.String matchAndApply(java.lang.String target, HttpServletRequest request, HttpServletResponse response) throws java.io.IOException
matchAndApply
in class Rule
target
- target field to pass on to the contained rulesrequest
- request object to pass on to the contained rulesresponse
- response object to pass on to the contained rulesjava.io.IOException
- TODOprotected java.lang.String apply(java.lang.String target, HttpServletRequest request, HttpServletResponse response) throws java.io.IOException
target
- target field to pass on to the contained rulesrequest
- request object to pass on to the contained rulesresponse
- response object to pass on to the contained rulesjava.io.IOException
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.