|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.rewrite.handler.Rule org.eclipse.jetty.rewrite.handler.RuleContainer
public class RuleContainer
Base container to group rules. Can be extended so that the contained rules will only be applied under certain conditions
Field Summary | |
---|---|
protected boolean |
_handled
|
protected LegacyRule |
_legacy
|
protected String |
_originalPathAttribute
|
protected boolean |
_rewritePathInfo
|
protected boolean |
_rewriteRequestURI
|
protected Rule[] |
_rules
|
Fields inherited from class org.eclipse.jetty.rewrite.handler.Rule |
---|
_handling, _terminating |
Constructor Summary | |
---|---|
RuleContainer()
|
Method Summary | |
---|---|
void |
addRewriteRule(String pattern,
String prefix)
Deprecated. |
void |
addRule(Rule rule)
Add a Rule |
protected String |
apply(String target,
HttpServletRequest request,
HttpServletResponse response)
Process the contained rules (called by matchAndApply) |
String |
getOriginalPathAttribute()
|
PathMap |
getRewrite()
Deprecated. |
Rule[] |
getRules()
Returns the list of rules. |
boolean |
isHandled()
|
boolean |
isRewritePathInfo()
|
boolean |
isRewriteRequestURI()
|
String |
matchAndApply(String target,
HttpServletRequest request,
HttpServletResponse response)
Process the contained rules |
void |
setHandled(boolean handled)
|
void |
setLegacyRule(LegacyRule legacyRule)
To enable configuration from jetty.xml on rewriteRequestURI, rewritePathInfo and originalPathAttribute |
void |
setOriginalPathAttribute(String originalPathAttribte)
|
void |
setRewrite(PathMap rewrite)
Deprecated. |
void |
setRewritePathInfo(boolean rewritePathInfo)
|
void |
setRewriteRequestURI(boolean rewriteRequestURI)
|
void |
setRules(Rule[] rules)
Assigns the rules to process. |
Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule |
---|
isHandling, isTerminating, setHandling, setTerminating, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Rule[] _rules
protected boolean _handled
protected String _originalPathAttribute
protected boolean _rewriteRequestURI
protected boolean _rewritePathInfo
protected LegacyRule _legacy
Constructor Detail |
---|
public RuleContainer()
Method Detail |
---|
public void setLegacyRule(LegacyRule legacyRule)
legacyRule
- old style rewrite rulepublic Rule[] getRules()
Rule
.public 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 String getOriginalPathAttribute()
public void setOriginalPathAttribute(String originalPathAttribte)
originalPathAttribte
- If non null, this string will be used
as the attribute name to store the original request path.public PathMap getRewrite()
public void setRewrite(PathMap rewrite)
public void addRewriteRule(String pattern, String prefix)
public boolean isHandled()
public void setHandled(boolean handled)
handled
- true if one of the rules within the rule container is handling the requestpublic String matchAndApply(String target, HttpServletRequest request, HttpServletResponse response) throws 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 rules
IOException
- TODOprotected String apply(String target, HttpServletRequest request, HttpServletResponse response) throws 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 rules
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |